1. Setting up the GitHub account

Server Farmer is distributed directly from GIT repositories hosted by GitHub service. There are no files for download, no deb/rpm packages to install etc.

To start your adventure with Server Farmer, you need a GitHub account. You can create it for free here, and you won't ever need any GitHub paid features to work with Server Farmer. You can also share the same account for Server Farmer and your other projects (but beware that security of your systems managed by Server Farmer relies on security of your GitHub account).

The below instructions assume that you already have a GitHub account named your-github-login.

2. Forking and preparing the main repository

Server Farmer consists of about 40 GIT repositories. But don't worry, you will need to fork only one of them, and edit only one small file in the forked repository. To start, just click on this link and then look for the Fork button in the upper section of the page:

Fork

Just click on it and you're done. You just created your own copy of Server Farmer's main repository. Now you need to edit the global configuration file. Paste the below link into the browser, and remember to change your-github-login to your GitHub login:


                https://github.com/your-github-login/serverfarmer/edit/master/scripts/functions.custom
              

On this page you will find detailed explanations of each configuration option. During the first configuration pay special attention to these 3 options, everything else you can change later: external_domain, internal_domain and ssh_management_key_string (at least replace the public keys in the last one with your real ssh keys).

3. Actual installation

Before you start installing Server Farmer on your servers, it is essential that you have a basic understanding of Server Farmer main server roles: farm manager and backup collector.

Ok, let's start. To install Server Farmer on your servers, you just need to log in as root and follow these console commands (again remember to change your-github-login to your GitHub login):


git clone https://github.com/your-github-login/serverfarmer /opt/farm
/opt/farm/setup.sh
/opt/farm/setup.sh
              

It's not a mistake. When you run setup.sh script for the first time, it will ask you a few basic questions, like destination server hostname. The second time it will run the actual installation (install required system packages, extensions, ssh keys etc.).

And that's all for a single server. Server Farmer is working and you should immediately start receiving notifications about possible issues found on your server (if there are any).

4. Creating a simple server farm

Each server, right after installing Server Farmer, is ready to be connected to the server farm (so it already has proper ssh keys installed etc.). The following example assumes that you have already installed Server Farmer on 2 servers: you type this commands on the first one, and the second one is called your-second-server.com:


/opt/farm/scripts/setup/role.sh sf-farm-manager
/opt/farm/scripts/setup/role.sh sf-backup-collector
add-managed-host your-second-server.com
sf-console your-second-server.com
              

And that's it. The last command should let you in to the second server's console, without typing any passwords or prividing keys. Congratulations, now you have a functioning farm and you can start further extending it.