Configuring a shell server

To begin, select Shell as your server's protocol. Note that the server must be able to connect through SSH as a prerequisite for this setup.

The server form is organized into sections:

Server Details

Enter your server's hostname, port, and username. Shell servers always use SSH key authentication (password authentication is not available for this protocol).

Shell Server Details

Authentication

The Authentication section provides two methods to install your SSH key:

  • Public Key -- Displays your project's public SSH key. Copy this key and add it to the authorized_keys file on your server.
  • Setup Script -- Provides a ready-to-use shell script that you can copy and paste into your server's terminal to automatically install the SSH key.

Shell Authentication - Public Key tab

Shell Authentication - Setup Script tab

Working Directory

Enter the working directory for this server. Even though your repository files are not uploaded with this server's deployments, you can specify the working folder where your config files will be uploaded, and where your commands will be run in.

Shell Working Directory

SSH Commands

Add the SSH command(s) you wish to run on this server. These commands will be run each time a deployment to this shell server is triggered. You can also specify the command's behavior and additional details.

Shell Commands

Once all settings are set, save the server, and you're set!

SSH Key authentication

To install the key, you can use the Setup Script tab for a one-step installation, or manually copy the key from the Public Key tab and add it to the server yourself.

To install the key manually, login to your server as the same user that you're configuring in DeployHQ, then run the following commands:

cd ~/.ssh/
nano authorized_keys

Then, paste the key into the file as a new line, with no trailing spaces. Then, press Ctrl+X, then y, then hit enter to save your key.