Getting a Production Server

Having hosted applications on the IIS servers in an in-house data center, experimented with Google App Engine, tried to understand AWS and Azure's complex pricing, we settled on a superior service provided by DigitalOcean.

DigitalOcean has no-surprises, transparent subscription pricing, great documentation, and a simple access to what we can set up, manage, and control with ease: a Linux virtual machine.

Generating SSH Keys

Prior to procuring a server, please generate SSH keys to connect to your production server, they are more secure than passwords. If you are using Windows, please use Putty.

From your home directory, create a new SSH key.

ssh-keygen -t rsa

As a file name, enter .ssh/server-url. For example, .ssh/code.linedrop.io.

Keep the password empty.

To view all your ssh keys, run:

ls ~/.ssh

Creating a Production Server

For a straight-forward setup and no-surprises subscription pricing, we recommend using DigitalOcean service: https://www.digitalocean.com.

Creating a Project

Browse to Create your account on Digital Ocean and create an account.

Click + New Project

Name your project and enter your details to describe your project setup.

For example:

  • Name: Code
  • Description: LineDrop Code blog application silo
  • What it’s for: Web Application

Click Create Project. Skip the request to move resources.

Creating a Droplet

Droplet is a virtual machine which will host your production environment.

Click Droplets.

In the top-right corner, click Create and select Droplets.

Select Debian as the distribution and choose the latest version.

Choose Standard plan and select a VM that suits your needs. To view the least expensive VMs, scroll to the left. For a small subscriber app, we use the 1GB/1CPU with 25 GB SSD and 1000 GB transfer. Start small, you can always upgrade later.

Select your data center region. We’re in California, so we usually go with San Francisco.

Select Monitor option. It’s nice to see what your server loads are.

Choose SSH keys as your authentication method.

Click New SSH Key.

On your machine, view the SSH key you had previously created.

cat .ssh/key-name.pub

For example, .ssh/code.linedrop.io.pub

Copy the content of the key, starting with ssh-rsa…

Paste into SSH key content field on DigitalOcean portal.

Name the key with the server url, such as code.linedrop.io.

Click Add SSH Key.

Type in the production server URL in the Choose a hostname field.

Add backups if you like.

Click Create Droplet to start the process. Once complete, click on Droplets to view the IP address of your new server.

Adding a Firewall

DigitalOcean provides an easy way to add a firewall to your environment. The firewall will allow traffic only on the necessary ports.

In DigitalOcean portal, click Networking and select Firewalls. Click Create Firewall.

Name your firewall and set the following rules inbound rules:

  • SSH on port 22: used to remotely login into the server.
  • HTTP on port 80: used for web traffic.
  • HTTPS on port 443: used for secure web traffic.
  • Custom on port 465: used to send system emails via Gmail service.

Outbound Rules are configured automatically.

Search for the production server droplet, select the server, and apply the new firewall.

Click Create Firewall.


Next: Initial Server Connection