Nginx Auto-Start on Boot: Complete Guide
To enable automatic startup of nginx during boot, you can follow these steps:
- Open the terminal and enter the following command to install the nginx service.
sudo apt-get update
sudo apt-get install nginx
- Enter the following command to start the nginx service:
sudo systemctl start nginx
- Next, input the following command to enable auto-start of the nginx service:
sudo systemctl enable nginx
- To stop the nginx service, you can enter the following command:
sudo systemctl stop nginx
- To disable the automatic startup of nginx, you can input the following command:
sudo systemctl disable nginx
After setting it up this way, nginx will automatically start when the system boots up.