Dev.to•Feb 11, 2026, 2:49 AM
Dev.to drops NGINX setup guide: 12 sudo commands to birth a website, because AI still can't mkdir for you

Dev.to drops NGINX setup guide: 12 sudo commands to birth a website, because AI still can't mkdir for you

Setting up a new website in NGINX requires creating a site folder and setting user permissions. To begin, users run commands to create the site folder, set the user as the folder owner, and set permissions using sudo mkdir, chown, and chmod commands. A test index.html file is then created to verify the setup. To serve the content, a new server block is created with the right directives in a file at /etc/nginx/sites-available/{your-domain}. The file is then enabled by creating a symlink to sites-enabled. Additionally, the server_names_hash_bucket_size directive in /etc/nginx/nginx.conf is updated to avoid potential hash bucket memory issues. After checking for config errors using sudo nginx -t, NGINX is restarted with sudo systemctl restart nginx. This process allows NGINX to serve the new website, with the configuration file specifying the server name, root directory, and index files. The setup is crucial for web development and hosting, with NGINX being a popular web server software used by many companies and individuals worldwide.

Viral Score: 76%

More Roasted Feeds

No news articles yet. Click "Fetch Latest" to get started!