Posted on

How to configure a Trellis production server on Digital Ocean

Once your local environment is ready, let’s continue to set up the production server. Digital Ocean hosting is one good choice for the production server. Setting up the server is straightforward, just following these instructions.
When you choose the type of Droplet, select the plain Ubuntsu NOT the LEMP stack. Trellis should take care all the application configurations.

When your server is up, let’s configure it for the Trellis. First, create a new user and grant sudo access to deploy the Trellis. Replace USER_NAME to your own user name.

Sudo NOPASSWD option helps to automate the admin tasks. Grant no password sudo on the production server.

add this line at the end of line. It does not work if you add them before some statement.

Then configure the public key ssh login from your local environment.

and copy the key to the production server.

Paste the copied public key. Hit CTRL-x to exit the file, then y to save the changes that you made, then ENTER to confirm the file name.

Restrict the permissions of the authorized_keys file with this command:

Add alias to .zshrc so that I can connect to the production server.

Leave a Reply

Your email address will not be published. Required fields are marked *