Useful NGINX Commands Every Website Owner Should Know
NGINX becomes much easier to manage when you know the everyday commands. You do not need to be a full Linux expert, but learning a few basics can save time when restarting a website, checking errors, or confirming whether a configuration change is safe.
Check the installed NGINX version:
nginx -v
Check whether NGINX is running:
sudo systemctl status nginx
Start NGINX:
sudo systemctl start nginx
Stop NGINX:
sudo systemctl stop nginx
Restart NGINX:
sudo systemctl restart nginx
Reload NGINX without fully stopping active connections:
sudo systemctl reload nginx
Test the configuration before applying changes:
sudo nginx -t
Print the full loaded configuration:
sudo nginx -T
View recent service logs:
sudo journalctl -u nginx —no-pager -n 100
Watch the error log live:
sudo tail -f /var/log/nginx/error.log
Watch the access log live:
sudo tail -f /var/log/nginx/access.log
Check which process is using port 80 or 443:
sudo ss -tulpn | grep ‘:80|:443’
A good workflow is: edit the config, run sudo nginx -t, then reload. Avoid restarting blindly after every change. Reloading is usually smoother because NGINX can apply valid configuration changes without dropping active visitors.
If a website breaks, do not panic. Start with nginx -t, then check error logs, then confirm the backend application is running. Most NGINX issues come down to syntax mistakes, wrong file paths, missing SSL files, incorrect proxy ports, or folder permission problems.