Basic Commands in Nginx

From the Nginx cheat sheet ยท Installation & Basic Commands ยท verified Jul 2026

Basic Commands

Essential Nginx management commands

bash
# Start/Stop/Restart
sudo systemctl start nginx
sudo systemctl stop nginx
sudo systemctl restart nginx
sudo systemctl reload nginx

# Test configuration
sudo nginx -t

# Show current config
sudo nginx -T
โœ… Always test config before reload with nginx -t
๐Ÿ”„ Reload applies changes without dropping connections
๐Ÿ“ Config files in /etc/nginx/ directory
๐Ÿ“Š Logs in /var/log/nginx/ by default

More Nginx tasks

Back to the full Nginx cheat sheet