Linode Initial Server Setup to Deploy Web Apps

In this article, we will see how to setup a brand new server on Linode to deploy Web applications.

Step 1

Pick a OS and boot the Linode. I picked Ubuntu 18.04, because 18.10 has installation problems with nginx at this time.

Step 2

Set root password in Linode manager.

Step 3

SSH into the server as root:

ssh root@your-ip

If you want to reset root password:


Step 4

Add a user for deploying the Rails app:

adduser deploy

Provide deploy user password at the prompt.

Step 5

Give deploy user permissions


Add the line:

deploy   ALL=(ALL) ALL

after the line:

root ALL=(blah blah blah)

if you don't want to provide the password when you deploy:


This configuration is not needed if you set up password less login for deploy user as described in steps 6 and 7.

Step 6

On laptop:

cat ~/.ssh/

If the key is not already generated, generate it:

ssh-keygen -t rsa

Step 7

On your laptop, setup secure login into server without providing password:

ssh-copy-id deploy@your-ip

You will now be able to SSH into your Linode instance as deploy user without providing password:

ssh 'deploy@your-ip'

Step 8

Open ~/.ssh/config

Host blackbox
  User deploy

You can SSH into your server using the hostname for your server:

ssh blackbox

Step 9

On the server, as the deploy user, generate the ssh keys:

ssh-keygen -t rsa

Do not provide any password for the prompts.

Step 10

Copy the key:

cat /home/deploy/.ssh/

into bitbucket account. Now your server can pull code from your source code repository during deploy.


Rails Machine Wiki

Related Articles