Deploy flow overview
Deploy is the process of moving a website from your own computer to a server so others can access it. The flow is simple: point the domain to the server, install a web server, place the files, then enable HTTPS.
Pointing the domain
In your domain management panel, create a DNS record of type A that points to your server's IP address. For example:
# DNS record
# Type Name Value
# A @ 203.0.113.10
# A www 203.0.113.10
Installing Nginx
Nginx's job is to receive visitor requests and send the right files:
sudo apt install nginx -y
sudo systemctl enable nginx
sudo systemctl start nginx
Placing the website files
Put the static files in the web directory. An example of a minimal server block configuration:
server {
listen 80;
server_name contoh.biz.id;
root /var/www/contoh;
index index.html;
location / {
try_files $uri $uri/ =404;
}
}
Enabling SSL
An SSL certificate makes the connection encrypted so the address changes from http to https. One common approach is to use Certbot:
sudo apt install certbot python3-certbot-nginx -y
sudo certbot --nginx -d contoh.biz.id -d www.contoh.biz.id
Security notes
Make sure only the necessary ports are open. Update packages regularly and monitor the SSL certificate's expiry date. After deploying, test from another device to confirm the website is truly accessible to the public.
Ask via WhatsApp and we'll explain it in plain language.