{"id":18604,"date":"2025-02-03T09:19:45","date_gmt":"2025-02-03T09:19:45","guid":{"rendered":"https:\/\/truehost.com\/support\/?post_type=docs&#038;p=18604"},"modified":"2025-04-09T15:09:40","modified_gmt":"2025-04-09T15:09:40","password":"","slug":"how-to-set-up-a-website-on-a-vps-with-nginx-and-ssl-on-almalinux","status":"publish","type":"docs","link":"https:\/\/www.truehost.com\/support\/knowledge-base\/how-to-set-up-a-website-on-a-vps-with-nginx-and-ssl-on-almalinux\/","title":{"rendered":"How to Set Up a Website on a VPS with Nginx"},"content":{"rendered":"\n<p><\/p>\n\n\n\n<p>Setting up a website on a VPS (Virtual Private Server) is a fundamental skill for developers, system administrators, and anyone looking to host their own website. In this guide, we\u2019ll walk you through the process of setting up a website on a VPS using\u00a0<strong>Nginx<\/strong>\u00a0on\u00a0<strong>AlmaLinux<\/strong>. We\u2019ll also cover how to secure your site with a free SSL certificate from\u00a0<strong>Let\u2019s Encrypt<\/strong>\u00a0and enable automatic renewal.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Prerequisites<\/strong><\/h2>\n\n\n\n<p>Before starting, ensure you have the following:<\/p>\n\n\n\n<ol class=\"wp-block-list\" start=\"1\">\n<li><strong>A VPS running AlmaLinux<\/strong>: You should have root or sudo access to the server.<\/li>\n\n\n\n<li><strong>A Fully Qualified Domain Name (FQDN)<\/strong>: Your domain name (e.g.,\u00a0<code>example.com<\/code>) must be pointed to your server\u2019s IP address via DNS settings.<\/li>\n\n\n\n<li><strong>SSH Access<\/strong>: You should be able to connect to your server via SSH.<\/li>\n<\/ol>\n\n\n\n<p>In my case, I&#8217;ll be using a <strong><em>subdomain<\/em><\/strong> as below.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"191\" src=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2025\/02\/image-2-1024x191.png\" alt=\"\" class=\"wp-image-18607\" srcset=\"https:\/\/www.truehost.com\/support\/wp-content\/uploads\/2025\/02\/image-2-1024x191.png 1024w, https:\/\/www.truehost.com\/support\/wp-content\/uploads\/2025\/02\/image-2-300x56.png 300w, https:\/\/www.truehost.com\/support\/wp-content\/uploads\/2025\/02\/image-2-768x143.png 768w, https:\/\/www.truehost.com\/support\/wp-content\/uploads\/2025\/02\/image-2.png 1036w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Step 1: Update System Repositories<\/strong><\/h2>\n\n\n\n<p>Start by updating your system\u2019s package repositories to ensure you have the latest software versions:<\/p>\n\n\n\n<p><strong><em><code>sudo yum -y update<\/code><\/em><\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"159\" src=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2025\/02\/image-1024x159.png\" alt=\"\" class=\"wp-image-18605\" srcset=\"https:\/\/www.truehost.com\/support\/wp-content\/uploads\/2025\/02\/image-1024x159.png 1024w, https:\/\/www.truehost.com\/support\/wp-content\/uploads\/2025\/02\/image-300x47.png 300w, https:\/\/www.truehost.com\/support\/wp-content\/uploads\/2025\/02\/image-768x119.png 768w, https:\/\/www.truehost.com\/support\/wp-content\/uploads\/2025\/02\/image.png 1192w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Step 2: Install Nginx<\/strong><\/h2>\n\n\n\n<p>Nginx is a high-performance web server that will host your website. Install it using the following commands:<\/p>\n\n\n\n<p><strong><em><code>sudo yum install nginx -y<\/code><\/em><\/strong><\/p>\n\n\n\n<p>Once installed, enable and start the Nginx service:<\/p>\n\n\n\n<p><strong><em><code>sudo systemctl enable --now nginx<\/code><\/em><\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"243\" src=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2025\/02\/image-1-1024x243.png\" alt=\"\" class=\"wp-image-18606\" srcset=\"https:\/\/www.truehost.com\/support\/wp-content\/uploads\/2025\/02\/image-1-1024x243.png 1024w, https:\/\/www.truehost.com\/support\/wp-content\/uploads\/2025\/02\/image-1-300x71.png 300w, https:\/\/www.truehost.com\/support\/wp-content\/uploads\/2025\/02\/image-1-768x182.png 768w, https:\/\/www.truehost.com\/support\/wp-content\/uploads\/2025\/02\/image-1.png 1345w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>You can verify that Nginx is running by visiting your server\u2019s IP address in a web browser. You should see the default Nginx welcome page.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Step 3: Create the Website Directory Structure<\/strong><\/h2>\n\n\n\n<p>Create a directory to store your website files. Replace\u00a0<code>example.com<\/code>\u00a0with your actual domain name:<\/p>\n\n\n\n<p><strong><em><code>sudo mkdir -p \/var\/www\/example.com\/public_html<\/code><\/em><\/strong> <\/p>\n\n\n\n<p>Set the correct permissions for the directory:<\/p>\n\n\n\n<p><strong><em><code>sudo chown -R nginx:nginx \/var\/www\/example.com\/public_html<br>sudo chmod -R 755 \/var\/www\/example.com<\/code><\/em><\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"170\" src=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2025\/02\/image-3-1024x170.png\" alt=\"\" class=\"wp-image-18608\" srcset=\"https:\/\/www.truehost.com\/support\/wp-content\/uploads\/2025\/02\/image-3-1024x170.png 1024w, https:\/\/www.truehost.com\/support\/wp-content\/uploads\/2025\/02\/image-3-300x50.png 300w, https:\/\/www.truehost.com\/support\/wp-content\/uploads\/2025\/02\/image-3-768x128.png 768w, https:\/\/www.truehost.com\/support\/wp-content\/uploads\/2025\/02\/image-3.png 1358w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Step 4: Create a Sample HTML Page<\/strong><\/h2>\n\n\n\n<p>Create a simple&nbsp;<code>index.html<\/code>&nbsp;file to test your website setup:<\/p>\n\n\n\n<p><strong><em><code>sudo nano \/var\/www\/example.com\/public_html\/index.html<\/code><\/em><\/strong> <\/p>\n\n\n\n<p>Add the following HTML content: (Edit as needed)<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"530\" src=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2025\/02\/image-4-1024x530.png\" alt=\"\" class=\"wp-image-18609\" srcset=\"https:\/\/www.truehost.com\/support\/wp-content\/uploads\/2025\/02\/image-4-1024x530.png 1024w, https:\/\/www.truehost.com\/support\/wp-content\/uploads\/2025\/02\/image-4-300x155.png 300w, https:\/\/www.truehost.com\/support\/wp-content\/uploads\/2025\/02\/image-4-768x397.png 768w, https:\/\/www.truehost.com\/support\/wp-content\/uploads\/2025\/02\/image-4.png 1357w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Save and close the file.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Step 5: Configure Nginx Server Blocks<\/strong><\/h2>\n\n\n\n<p>Next, create an Nginx server block (virtual host) configuration for your domain: <\/p>\n\n\n\n<p><strong><em><code>sudo nano \/etc\/nginx\/conf.d\/example.com.conf<\/code><\/em><\/strong><\/p>\n\n\n\n<p>Add the following configuration:<\/p>\n\n\n\n<p>replace <strong><em><code>example.com<\/code><\/em><\/strong> with your domain name. <\/p>\n\n\n\n<p><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>server {\n    listen 80;\n    server_name example.com www.example.com;\n\n    root \/var\/www\/example.com\/public_html;\n    index index.html index.htm index.php;\n\n    access_log \/var\/log\/nginx\/example.com_access.log;\n    error_log \/var\/log\/nginx\/example.com_error.log;\n\n    location \/ {\n        try_files $uri $uri\/ =404;\n    }\n\n    location ~ \\.php$ {\n        include fastcgi_params;\n        fastcgi_pass unix:\/run\/php-fpm\/www.sock;\n        fastcgi_index index.php;\n        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;\n    }\n}\n<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"474\" src=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2025\/02\/image-6-1024x474.png\" alt=\"\" class=\"wp-image-18611\" srcset=\"https:\/\/www.truehost.com\/support\/wp-content\/uploads\/2025\/02\/image-6-1024x474.png 1024w, https:\/\/www.truehost.com\/support\/wp-content\/uploads\/2025\/02\/image-6-300x139.png 300w, https:\/\/www.truehost.com\/support\/wp-content\/uploads\/2025\/02\/image-6-768x355.png 768w, https:\/\/www.truehost.com\/support\/wp-content\/uploads\/2025\/02\/image-6.png 1336w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Save and close the file.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Step 6: Test and Reload\/Restart Nginx<\/strong><\/h2>\n\n\n\n<p>Before restarting Nginx, test the configuration to ensure there are no syntax errors:<\/p>\n\n\n\n<p><strong><em><code>sudo nginx -t<\/code><\/em><\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"136\" src=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2025\/02\/image-7-1024x136.png\" alt=\"\" class=\"wp-image-18612\" srcset=\"https:\/\/www.truehost.com\/support\/wp-content\/uploads\/2025\/02\/image-7-1024x136.png 1024w, https:\/\/www.truehost.com\/support\/wp-content\/uploads\/2025\/02\/image-7-300x40.png 300w, https:\/\/www.truehost.com\/support\/wp-content\/uploads\/2025\/02\/image-7-768x102.png 768w, https:\/\/www.truehost.com\/support\/wp-content\/uploads\/2025\/02\/image-7.png 1246w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>If the test is successful, restart or reload Nginx to apply the changes:<\/p>\n\n\n\n<p><strong><em><code>sudo systemctl reload nginx <\/code><\/em><\/strong> or <strong><em><code>sudo systemctl restart nginx <\/code><\/em><\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"207\" src=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2025\/02\/image-8-1024x207.png\" alt=\"\" class=\"wp-image-18613\" srcset=\"https:\/\/www.truehost.com\/support\/wp-content\/uploads\/2025\/02\/image-8-1024x207.png 1024w, https:\/\/www.truehost.com\/support\/wp-content\/uploads\/2025\/02\/image-8-300x61.png 300w, https:\/\/www.truehost.com\/support\/wp-content\/uploads\/2025\/02\/image-8-768x155.png 768w, https:\/\/www.truehost.com\/support\/wp-content\/uploads\/2025\/02\/image-8.png 1260w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Your website should now be accessible at\u00a0<code>http:\/\/example.com<\/code>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"454\" src=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2025\/02\/image-9-1024x454.png\" alt=\"\" class=\"wp-image-18614\" srcset=\"https:\/\/www.truehost.com\/support\/wp-content\/uploads\/2025\/02\/image-9-1024x454.png 1024w, https:\/\/www.truehost.com\/support\/wp-content\/uploads\/2025\/02\/image-9-300x133.png 300w, https:\/\/www.truehost.com\/support\/wp-content\/uploads\/2025\/02\/image-9-768x341.png 768w, https:\/\/www.truehost.com\/support\/wp-content\/uploads\/2025\/02\/image-9.png 1197w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Part 2: Installing a Free SSL Certificate with Let\u2019s Encrypt<\/strong><\/h2>\n\n\n\n<p>Securing your website with an SSL certificate is essential for encrypting traffic and building trust with visitors. Let\u2019s Encrypt provides free SSL certificates that are easy to install and renew.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 1: Install Certbot and the Nginx Plugin<\/strong><\/h3>\n\n\n\n<p>Certbot is a tool that automates the process of obtaining and renewing SSL certificates. Install it along with the Nginx plugin:<\/p>\n\n\n\n<p><strong><em><code>sudo dnf install epel-release -y<br>sudo yum install certbot python3-certbot-nginx -y<\/code><\/em><\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"345\" src=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2025\/02\/image-10-1024x345.png\" alt=\"\" class=\"wp-image-18615\" srcset=\"https:\/\/www.truehost.com\/support\/wp-content\/uploads\/2025\/02\/image-10-1024x345.png 1024w, https:\/\/www.truehost.com\/support\/wp-content\/uploads\/2025\/02\/image-10-300x101.png 300w, https:\/\/www.truehost.com\/support\/wp-content\/uploads\/2025\/02\/image-10-768x259.png 768w, https:\/\/www.truehost.com\/support\/wp-content\/uploads\/2025\/02\/image-10.png 1345w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 2: Generate an SSL Certificate<\/strong><\/h3>\n\n\n\n<p>Run the following command to obtain an SSL certificate for your domain:<\/p>\n\n\n\n<p>Follow the prompts to complete the process. Certbot will automatically configure Nginx to use the SSL certificate. (For Subsequent certificate requests, there will be no prompts as in my case as below)<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><em><strong><code>sudo certbot --nginx -d example.com -d www.example.com <\/code><\/strong><\/em><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"514\" src=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2025\/02\/image-11-1024x514.png\" alt=\"\" class=\"wp-image-18616\" srcset=\"https:\/\/www.truehost.com\/support\/wp-content\/uploads\/2025\/02\/image-11-1024x514.png 1024w, https:\/\/www.truehost.com\/support\/wp-content\/uploads\/2025\/02\/image-11-300x151.png 300w, https:\/\/www.truehost.com\/support\/wp-content\/uploads\/2025\/02\/image-11-768x386.png 768w, https:\/\/www.truehost.com\/support\/wp-content\/uploads\/2025\/02\/image-11.png 1354w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Access your site and confirm SSL is installed. <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"528\" src=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2025\/02\/image-12-1024x528.png\" alt=\"\" class=\"wp-image-18617\" srcset=\"https:\/\/www.truehost.com\/support\/wp-content\/uploads\/2025\/02\/image-12-1024x528.png 1024w, https:\/\/www.truehost.com\/support\/wp-content\/uploads\/2025\/02\/image-12-300x155.png 300w, https:\/\/www.truehost.com\/support\/wp-content\/uploads\/2025\/02\/image-12-768x396.png 768w, https:\/\/www.truehost.com\/support\/wp-content\/uploads\/2025\/02\/image-12.png 1323w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 3: Enable Automatic SSL Renewal<\/strong><\/h3>\n\n\n\n<p>Let\u2019s Encrypt certificates expire every 90 days, so it\u2019s important to set up automatic renewal. Certbot automatically adds a cron job for this, but you can test the renewal process manually:<\/p>\n\n\n\n<p>Open crontab and add the following cronjob<\/p>\n\n\n\n<p><strong><em><code>crontab -e<\/code><\/em><\/strong><\/p>\n\n\n\n<p><strong><em><code>\"0 0,12 * * * \/usr\/bin\/certbot renew --quiet\"<\/code><\/em><\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Part 3 : Automated Setup <\/strong><\/h2>\n\n\n\n<p>If you however do NOT wish to do this manually, you may use the<strong> Automated script<\/strong> below. <\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Download the script using curl<\/h3>\n\n\n\n<p><em><strong><code>curl -O https:\/\/gitlab.com\/dannydev77\/nginx-setup\/-\/raw\/main\/setup_website.sh<\/code><\/strong><\/em><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Make the script executable<\/h3>\n\n\n\n<p><strong><em><code>chmod +x setup_website.sh<\/code><\/em><\/strong><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Run the script using Bash<\/h3>\n\n\n\n<p><strong><em><code>bash setup_website.sh<\/code><\/em><\/strong> <em><strong><code>domain.com<\/code><\/strong><\/em> <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"505\" src=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2025\/02\/image-13-1024x505.png\" alt=\"\" class=\"wp-image-18625\" srcset=\"https:\/\/www.truehost.com\/support\/wp-content\/uploads\/2025\/02\/image-13-1024x505.png 1024w, https:\/\/www.truehost.com\/support\/wp-content\/uploads\/2025\/02\/image-13-300x148.png 300w, https:\/\/www.truehost.com\/support\/wp-content\/uploads\/2025\/02\/image-13-768x379.png 768w, https:\/\/www.truehost.com\/support\/wp-content\/uploads\/2025\/02\/image-13.png 1327w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"374\" src=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2025\/02\/image-14-1024x374.png\" alt=\"\" class=\"wp-image-18626\" srcset=\"https:\/\/www.truehost.com\/support\/wp-content\/uploads\/2025\/02\/image-14-1024x374.png 1024w, https:\/\/www.truehost.com\/support\/wp-content\/uploads\/2025\/02\/image-14-300x110.png 300w, https:\/\/www.truehost.com\/support\/wp-content\/uploads\/2025\/02\/image-14-768x281.png 768w, https:\/\/www.truehost.com\/support\/wp-content\/uploads\/2025\/02\/image-14.png 1212w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Conclusion<\/strong><\/h2>\n\n\n\n<p>Congratulations! You\u2019ve successfully set up a website on a VPS using Nginx on AlmaLinux and secured it with a free SSL certificate from Let\u2019s Encrypt.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>You can now upload your website files to&nbsp;<code>\/var\/www\/example.com\/public_html<\/code>&nbsp;and start hosting your site. Happy hosting! ?<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>If you have any questions or run into issues, feel free to leave a comment below!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Setting up a website on a VPS (Virtual Private Server) is a fundamental skill for developers, system administrators, and anyone looking to host their own website. In this guide, we\u2019ll walk you through the process of setting up a website on a VPS using\u00a0Nginx\u00a0on\u00a0AlmaLinux. We\u2019ll also cover how to secure your site with a free [&hellip;]<\/p>\n","protected":false},"author":24,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"_eb_attr":"","_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"doc_category":[2140,1879,2128],"doc_tag":[],"class_list":["post-18604","docs","type-docs","status-publish","hentry","doc_category-dns","doc_category-servers","doc_category-vps-servers"],"year_month":"2026-06","word_count":815,"total_views":0,"reactions":{"happy":0,"normal":0,"sad":0},"author_info":{"name":"Kibera","author_nicename":"dan-k","author_url":"https:\/\/www.truehost.com\/support\/author\/dan-k\/"},"doc_category_info":[{"term_name":"DNS","term_url":"https:\/\/www.truehost.com\/support\/docs-category\/dns\/"},{"term_name":"Servers","term_url":"https:\/\/www.truehost.com\/support\/docs-category\/servers\/"},{"term_name":"VPS-Servers","term_url":"https:\/\/www.truehost.com\/support\/docs-category\/vps-servers\/"}],"doc_tag_info":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Set Up a Website on a VPS with Nginx -<\/title>\n<meta name=\"description\" content=\"Learn how to set up a website on a VPS with Nginx on AlmaLinux, secure it with a free Let\u2019s Encrypt SSL, and enable automatic renewal.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.truehost.com\/support\/knowledge-base\/how-to-set-up-a-website-on-a-vps-with-nginx-and-ssl-on-almalinux\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Set Up a Website on a VPS with Nginx -\" \/>\n<meta property=\"og:description\" content=\"Learn how to set up a website on a VPS with Nginx on AlmaLinux, secure it with a free Let\u2019s Encrypt SSL, and enable automatic renewal.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.truehost.com\/support\/knowledge-base\/how-to-set-up-a-website-on-a-vps-with-nginx-and-ssl-on-almalinux\/\" \/>\n<meta property=\"article:modified_time\" content=\"2025-04-09T15:09:40+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2025\/02\/image-2-1024x191.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.truehost.com\\\/support\\\/knowledge-base\\\/how-to-set-up-a-website-on-a-vps-with-nginx-and-ssl-on-almalinux\\\/\",\"url\":\"https:\\\/\\\/www.truehost.com\\\/support\\\/knowledge-base\\\/how-to-set-up-a-website-on-a-vps-with-nginx-and-ssl-on-almalinux\\\/\",\"name\":\"How to Set Up a Website on a VPS with Nginx -\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.truehost.com\\\/support\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.truehost.com\\\/support\\\/knowledge-base\\\/how-to-set-up-a-website-on-a-vps-with-nginx-and-ssl-on-almalinux\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.truehost.com\\\/support\\\/knowledge-base\\\/how-to-set-up-a-website-on-a-vps-with-nginx-and-ssl-on-almalinux\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/truehost.com\\\/support\\\/wp-content\\\/uploads\\\/2025\\\/02\\\/image-2-1024x191.png\",\"datePublished\":\"2025-02-03T09:19:45+00:00\",\"dateModified\":\"2025-04-09T15:09:40+00:00\",\"description\":\"Learn how to set up a website on a VPS with Nginx on AlmaLinux, secure it with a free Let\u2019s Encrypt SSL, and enable automatic renewal.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.truehost.com\\\/support\\\/knowledge-base\\\/how-to-set-up-a-website-on-a-vps-with-nginx-and-ssl-on-almalinux\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.truehost.com\\\/support\\\/knowledge-base\\\/how-to-set-up-a-website-on-a-vps-with-nginx-and-ssl-on-almalinux\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.truehost.com\\\/support\\\/knowledge-base\\\/how-to-set-up-a-website-on-a-vps-with-nginx-and-ssl-on-almalinux\\\/#primaryimage\",\"url\":\"https:\\\/\\\/truehost.com\\\/support\\\/wp-content\\\/uploads\\\/2025\\\/02\\\/image-2-1024x191.png\",\"contentUrl\":\"https:\\\/\\\/truehost.com\\\/support\\\/wp-content\\\/uploads\\\/2025\\\/02\\\/image-2-1024x191.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.truehost.com\\\/support\\\/knowledge-base\\\/how-to-set-up-a-website-on-a-vps-with-nginx-and-ssl-on-almalinux\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.truehost.com\\\/support\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Set Up a Website on a VPS with Nginx\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.truehost.com\\\/support\\\/#website\",\"url\":\"https:\\\/\\\/www.truehost.com\\\/support\\\/\",\"name\":\"\",\"description\":\"Help In a Click\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.truehost.com\\\/support\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.truehost.com\\\/support\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.truehost.com\\\/support\\\/#organization\",\"name\":\"Truehost Kenya\",\"url\":\"https:\\\/\\\/www.truehost.com\\\/support\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.truehost.com\\\/support\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.truehost.com\\\/support\\\/wp-content\\\/uploads\\\/2026\\\/04\\\/cropped-image_2026-04-16_174808866.png\",\"contentUrl\":\"https:\\\/\\\/www.truehost.com\\\/support\\\/wp-content\\\/uploads\\\/2026\\\/04\\\/cropped-image_2026-04-16_174808866.png\",\"width\":240,\"height\":48,\"caption\":\"Truehost Kenya\"},\"image\":{\"@id\":\"https:\\\/\\\/www.truehost.com\\\/support\\\/#\\\/schema\\\/logo\\\/image\\\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Set Up a Website on a VPS with Nginx -","description":"Learn how to set up a website on a VPS with Nginx on AlmaLinux, secure it with a free Let\u2019s Encrypt SSL, and enable automatic renewal.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.truehost.com\/support\/knowledge-base\/how-to-set-up-a-website-on-a-vps-with-nginx-and-ssl-on-almalinux\/","og_locale":"en_US","og_type":"article","og_title":"How to Set Up a Website on a VPS with Nginx -","og_description":"Learn how to set up a website on a VPS with Nginx on AlmaLinux, secure it with a free Let\u2019s Encrypt SSL, and enable automatic renewal.","og_url":"https:\/\/www.truehost.com\/support\/knowledge-base\/how-to-set-up-a-website-on-a-vps-with-nginx-and-ssl-on-almalinux\/","article_modified_time":"2025-04-09T15:09:40+00:00","og_image":[{"url":"https:\/\/truehost.com\/support\/wp-content\/uploads\/2025\/02\/image-2-1024x191.png","type":"","width":"","height":""}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.truehost.com\/support\/knowledge-base\/how-to-set-up-a-website-on-a-vps-with-nginx-and-ssl-on-almalinux\/","url":"https:\/\/www.truehost.com\/support\/knowledge-base\/how-to-set-up-a-website-on-a-vps-with-nginx-and-ssl-on-almalinux\/","name":"How to Set Up a Website on a VPS with Nginx -","isPartOf":{"@id":"https:\/\/www.truehost.com\/support\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.truehost.com\/support\/knowledge-base\/how-to-set-up-a-website-on-a-vps-with-nginx-and-ssl-on-almalinux\/#primaryimage"},"image":{"@id":"https:\/\/www.truehost.com\/support\/knowledge-base\/how-to-set-up-a-website-on-a-vps-with-nginx-and-ssl-on-almalinux\/#primaryimage"},"thumbnailUrl":"https:\/\/truehost.com\/support\/wp-content\/uploads\/2025\/02\/image-2-1024x191.png","datePublished":"2025-02-03T09:19:45+00:00","dateModified":"2025-04-09T15:09:40+00:00","description":"Learn how to set up a website on a VPS with Nginx on AlmaLinux, secure it with a free Let\u2019s Encrypt SSL, and enable automatic renewal.","breadcrumb":{"@id":"https:\/\/www.truehost.com\/support\/knowledge-base\/how-to-set-up-a-website-on-a-vps-with-nginx-and-ssl-on-almalinux\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.truehost.com\/support\/knowledge-base\/how-to-set-up-a-website-on-a-vps-with-nginx-and-ssl-on-almalinux\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.truehost.com\/support\/knowledge-base\/how-to-set-up-a-website-on-a-vps-with-nginx-and-ssl-on-almalinux\/#primaryimage","url":"https:\/\/truehost.com\/support\/wp-content\/uploads\/2025\/02\/image-2-1024x191.png","contentUrl":"https:\/\/truehost.com\/support\/wp-content\/uploads\/2025\/02\/image-2-1024x191.png"},{"@type":"BreadcrumbList","@id":"https:\/\/www.truehost.com\/support\/knowledge-base\/how-to-set-up-a-website-on-a-vps-with-nginx-and-ssl-on-almalinux\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.truehost.com\/support\/"},{"@type":"ListItem","position":2,"name":"How to Set Up a Website on a VPS with Nginx"}]},{"@type":"WebSite","@id":"https:\/\/www.truehost.com\/support\/#website","url":"https:\/\/www.truehost.com\/support\/","name":"","description":"Help In a Click","publisher":{"@id":"https:\/\/www.truehost.com\/support\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.truehost.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.truehost.com\/support\/#organization","name":"Truehost Kenya","url":"https:\/\/www.truehost.com\/support\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.truehost.com\/support\/#\/schema\/logo\/image\/","url":"https:\/\/www.truehost.com\/support\/wp-content\/uploads\/2026\/04\/cropped-image_2026-04-16_174808866.png","contentUrl":"https:\/\/www.truehost.com\/support\/wp-content\/uploads\/2026\/04\/cropped-image_2026-04-16_174808866.png","width":240,"height":48,"caption":"Truehost Kenya"},"image":{"@id":"https:\/\/www.truehost.com\/support\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/www.truehost.com\/support\/wp-json\/wp\/v2\/docs\/18604","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.truehost.com\/support\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/www.truehost.com\/support\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/www.truehost.com\/support\/wp-json\/wp\/v2\/users\/24"}],"replies":[{"embeddable":true,"href":"https:\/\/www.truehost.com\/support\/wp-json\/wp\/v2\/comments?post=18604"}],"version-history":[{"count":5,"href":"https:\/\/www.truehost.com\/support\/wp-json\/wp\/v2\/docs\/18604\/revisions"}],"predecessor-version":[{"id":18627,"href":"https:\/\/www.truehost.com\/support\/wp-json\/wp\/v2\/docs\/18604\/revisions\/18627"}],"wp:attachment":[{"href":"https:\/\/www.truehost.com\/support\/wp-json\/wp\/v2\/media?parent=18604"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/www.truehost.com\/support\/wp-json\/wp\/v2\/doc_category?post=18604"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/www.truehost.com\/support\/wp-json\/wp\/v2\/doc_tag?post=18604"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}