Docs
First, you'll need to login into your server. You can use WinSCP for your FTP login & PuTTY for SSH. Open PuTTY and fill in your IP into host name and then connect. Then follow the on screen instructions on what user to login as and the password. Your username will most likely be "root" and password was set by you when purchasing or setting up this VPS.
When putting your password, you will not see actual typing for security reasons.
Updating System
Let's start off by making sure our system is up to date with updates, packages, ect.
Run the following command to update.
Node JS Install
I personally like to use NVM to manage my Node JS versions. You can follow other guides on this but make sure your Node version is above 16 :)
Then you'll restart your terminal session by closing it and re-opening it.
Then actually to install Node JS
NGINX Install
We'll use NGINX as a reverse proxy for our site. This will be further explained below. For now install like so.
After prompted, press Y
to install.
After that, go to your favorite web browser and make a new tab and type your VPS' IP. You should see the NGINX welcome page. If not then your installation was not correct or NGINX is not started.
MySQL Install
My site does require a MySQL Database to store applications & their data, status, ect.
To install MySQL, use this:
Again, press Y
to install.
Now you'll also need the MYSQL secure install by running this
Read along what is prompted and decide what you would like in the installation. Most of these you can just type Y
, but be sure to read.
Certbot Install (SSL)
To make sure your website has a SSL certificate (appears as secure), you'll need Certbot installed for this. Install it like below
NGINX Configuration
Credit to FAXES on this part.
Because EJS Websites use NodeJS to function we need to setup a proxy to have our website work on a domain through NGINX. Navigate to your NGINX site config: /etc/nginx/sites-available/default
Insert the below into your config file. Ensure to edit the relevant points. If this is your first time editing this file, you may feel free to delete all other content inside of it, so you start blank before pasting this in.
Restart Nginx to make the changes.
Now let's make an SSL certificate for our domain:
When prompted, it is advised to pick the second option to route all traffic securely with HTTPS.
If you'd like your SSL to auto renew, you can run this command sudo certbot renew --dry-run
Last updated