🛠️ VitNode is still in development! You can try it out, but it is not recommended to use it now in production.
🛠️ Get Started
Configuration Server

Configuration Server

Now let's configure the server to run the application.

Update & Download Packages

Update system

apt update && apt upgrade -d -y

Install Nginx

apt install nginx -y

Install sudo

apt install sudo -y

Install NodeJS 20

curl -fsSL https://deb.nodesource.com/setup_21.x | bash - &&\
 apt install -y nodejs

Install pnpm

npm i pnpm -g

Install Docker

https://docs.docker.com/engine/install/debian/ (opens in a new tab)

Swap Memory

Swap memory is a space on a disk that is used when the amount of physical RAM memory is full. When a Linux system runs out of RAM, inactive pages are moved from the RAM to the swap space.

Create swap file

fallocate -l 2G /swapfile

Secure swap file

chmod 600 /swapfile

Create swap area

mkswap /swapfile

Active swap

swapon /swapfile

Configuration Nginx

Create config file

Go to the /etc/nginx/sites-available directory and create a new file vitnode.conf with the following content:

server {
  listen 443 ssl http2;
 
  ssl_certificate         /etc/nginx/sites-available/ssl/cert-vitnode.pem;
  ssl_certificate_key     /etc/nginx/sites-available/ssl/key-vitnode.pem;
 
  server_name frontend.vitnode.com www.frontend.vitnode.com;
 
  # Redirect from www to non-www
  if ($host = www.frontend.vitnode.com) {
    return 301 https://frontend.vitnode.com$request_uri;
  }
 
  location / {
    proxy_pass http://localhost:3000;
    proxy_set_header X-Forwarded-Host $host;
  }
}
 
server {
  listen 443 ssl http2;
 
  ssl_certificate         /etc/nginx/sites-available/ssl/cert-vitnode.pem;
  ssl_certificate_key     /etc/nginx/sites-available/ssl/key-vitnode.pem;
 
  server_name backend.vitnode.com www.backend.vitnode.com;
 
  # Redirect from www to non-www
  if ($host = www.backend.vitnode.com) {
    return 301 https://backend.vitnode.com$request_uri;
  }
 
  location / {
    proxy_pass http://localhost:8080;
    proxy_set_header X-Forwarded-Host $host;
  }
}
 
server {
  listen 80;
 
  server_name frontend.vitnode.com www.frontend.vitnode.com backend.vitnode.com www.backend.vitnode.com;
 
  return 301 https://$server_name$request_uri;
}

Change frontend.vitnode.com to your domain for the frontend and backend.vitnode.com to your domain for the backend.

Finish configuration

Create a symbolic link to the sites-enabled directory:

ln -s /etc/nginx/sites-available/vitnode.conf /etc/nginx/sites-enabled/

Create a directory for SSL certificates:

mkdir /etc/nginx/sites-available/ssl

Remove the default configuration:

rm /etc/nginx/sites-enabled/default &&\
  rm /etc/nginx/sites-available/default

Upload SSL certificate

Open the /etc/nginx/sites-available/ssl directory and upload:

  • SSL certificate - cert-vitnode.pem,
  • Key - key-vitnode.pem

Restart Nginx

systemctl restart nginx

===============================

Allow Nginx through the firewall

Allow Nginx through the firewall

sudo ufw allow 'Nginx Full'

Enable the Firewall

sudo ufw enable

Restart SSH

sudo systemctl restart sshd

===============================

Configuration Server

Now let's configure the server to run the application.

Update & Download Packages

Update system

apt update && apt upgrade -d -y

Install Nginx

apt install nginx -y

Install sudo

apt install sudo -y

Install NodeJS 20

curl -fsSL https://deb.nodesource.com/setup_20.x | -E bash - &&\
 apt install -y nodejs

Install pnpm

npm i pnpm -g

Install Docker

https://docs.docker.com/engine/install/debian/ (opens in a new tab)

Swap Memory

Swap memory is a space on a disk that is used when the amount of physical RAM memory is full. When a Linux system runs out of RAM, inactive pages are moved from the RAM to the swap space.

Create swap file

sudo fallocate -l 2G /swapfile

Secure swap file

sudo chmod 600 /swapfile

Create swap area

sudo mkswap /swapfile

Active swap

sudo swapon /swapfile