I recently purchased a new Ubuntu server for my startup. Here's a concise guide, taking about 5 minutes, to set it up.
Setting up a new server can be quite rewarding. Following these steps, your server will be ready to host a web app created with Node.js and Nginx, and it can synchronize with your existing repository if necessary.
First, let's update the apt package list by running:
sudoapt update
Enable essential ports
In your provider’s panel, enable these ports:
80 for http
443 for https
22 for ssh
Install Nginx
Execute the command below to install Nginx, a popular web server:
sudoaptinstall nginx
To verify the Nginx service status, use:
systemctl status nginx
A successful installation will display output similar to this:
nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled) Active: active (running) since Sun 2023-11-19 10:20:28 CST; 10min ago
Docs: man:nginx(8) Main PID: 17963(nginx) Tasks: 3(limit: 1939) Memory: 3.8M
CPU: 31ms
CGroup: /system.slice/nginx.service
├─17963 "nginx: master process /usr/sbin/nginx -g daemon on; master_process on;" ├─17964 "nginx: worker process""""""""""""""""""""""""""""""""""""""""""""""""""""""" └─17965 "nginx: worker process"""""""""""""""""""""""""""""""""""""""""""""""""""""""