How do I login to my server with SSH?

Logging in to your server with SSH gives you access to the Rails console, databases, and everything else on the server

Written by Chris Oliver
Updated over a week ago
Note: You do not need to SSH into your server for many things which Hatchbox takes care of for you. For example, there is no need to install RVM or rbenv on your server as Hatchbox takes care of that stuff for you. Doing so will cause problems and may cause your deploys to fail.

First, you'll need to add an SSH key to your server. You can do this by visiting the SSH Keys section in the navbar.

Your SSH key is typically located at ~/.ssh/id_rsa.pub
Copy the public key and add it to Hatchbox. We will add this key to all of the servers on your account.

Once the SSH public key has been added to your servers, you'll be able to SSH in using that key.

Open your terminal and run the following command replacing "X.X.X.X" with your server's public IP address:
ssh deploy@X.X.X.X

You will then be logged into your server and you will see instructions on how to access your app folders and Rails console.

You can also login to the server as root if you need to install packages or other management things. Be careful using root because you can easily break things.
ssh root@X.X.X.X

Was this article helpful?