Deploy online 201

Nelisa still wants to see her statistics on a web page from her smartphone. Things are more complicated as we need a database for the application.

Deploy your Express application to a DigitalOcean VPS (Virtual Private Server), they have good tutorials.

Let’s go

Follow the steps below to deploy your application to a DigitalOcean VPS.

Setup Ubuntu, Node.JS server with MySQL

Create a new Ubuntu server on DigitalOcean. Ask your Code Mentor to email you an DigitalOcean invite.

Login

Once you have a server log in to it using ssh, like this:

ssh root@<your ip address>

You will be prompted for a password use the password that DigitalOcean emailed you. You will also need to change your root password. Follow the prompts to change the password.

apt-get update

Setup the server

First setup your server by following these instructions: Initial Server Setup with Ubuntu 14.04.

Decide on a DNS name for your server: <server_name>.projectcodex.co then email it with your servers IP address to your Code Mentor to link it to the domain name to the IP address.

Now install node:

Create sample application online

Now follow this article, from “Hello World Code” downwards.

Setup MySQL

Setup MySQL on the server as per these instructions. Please note you only want to install MySQL at this stage.

Deploy your application

To deploy your application:

More details:

The instructions above are a selection from these two articles:

You will need to follow some of these tutorials piecemeal as we are not using Apache as a web server or going to setup phpMyAdmin on the VPS.