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](https://i.ibb.co/20cpWFWZ/shell-server-details.png)

## 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](https://i.ibb.co/mrCsfYMC/rsync-auth-public-key.png)

![Shell Authentication - Setup Script tab](https://i.ibb.co/gM5Jdd4W/rsync-auth-setup-script.png)

## 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 <a href="https://www.deployhq.com/support/config-files" target="blank">config files</a> will be uploaded, and where your commands will be run in.

![Shell Working Directory](https://i.ibb.co/Y7zJ9sNj/shell-working-directory.png)

## 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](https://i.ibb.co/JjXKxw2w/shell-commands.png)

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:

```bash
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.