Deploying With Digital Ocean & nginx
DigitalOcean is a simple and robust cloud computing platform, designed for developers. It allows your to deploy websites on a remote server.
NGINX is a free, open-source, high-performance HTTP server and reverse proxy. NGINX is known for its high performance, stability, rich feature set, simple configuration, and low resource consumption. It allows you to deploy multiple sites and applications to a single Digital Ocean server.
The following steps apply for all sites.
1. Purchase a Digital Ocean Droplet.
Go to DigitalOcean.com and register. Once you register you will be able to create a "droplet", which will be your own virtual private server that runs on Digital Ocean's hardware.
Reference Digital Ocean's guides for creating a droplet.
We currently recommend that you choose Ubuntu 14.04.5
as your server type.
2. Create and register an SSH key with Digital Ocean.
An SSH key is a unique code generated by your computer that you can register with online services and servers so that you can be granted access and prevent others from do so. You will need to generate an SSH key in order to log into (SSH into) your DO server.
You can follow DO's guide to Creating and Registering and SSH key.
- SHH into your remote server.
- Clone your Git repository.
- Create an nginx file in the sites-available folder.
- Link your nginx file to the sites-enabled folder.
- Restart nginx.
For full-stack applications:
- Install Forever / PM2.
- Start your server.
For apps using MongoDB:
- Install MongoDB on your remote server.
- Restart your server.