{"id":2027,"date":"2025-06-13T01:58:31","date_gmt":"2025-02-19T16:01:24","guid":{"rendered":""},"modified":"2025-02-02T00:46:18","modified_gmt":"2025-02-01T23:46:18","slug":"how-to-deploy-ghost-blog-with-nginx-on-debian-12","status":"publish","type":"post","link":"https:\/\/netcloud24.com\/knowledgebase\/how-to-deploy-ghost-blog-with-nginx-on-debian-12\/","title":{"rendered":"How to Deploy Ghost Blog with Nginx on Debian 12"},"content":{"rendered":"<p>\u00a0<\/p>\n<\/p>\n<header>\n<h1>\u00a0<\/h1>\n<\/header>\n<section>\n<p>Ghost is a popular open-source platform for professional bloggers, offering a simple and modern interface with powerful publishing tools. In this tutorial, we will go through the steps to deploy the Ghost blogging platform with Nginx on Debian 12. Whether you&#8217;re deploying on a local server or on a <a href=\"https:\/\/ie.netcloud24.com\">VPS server<\/a>, this guide will help you get your Ghost blog up and running in no time.<\/p>\n<h2>Prerequisites<\/h2>\n<p>Before you begin, make sure you have the following:<\/p>\n<ul>\n<li>A server running Debian 12 (it can be a local machine or a ).<\/li>\n<li>Root access or a user with sudo privileges.<\/li>\n<li>A domain name (optional, but recommended for setting up Nginx).<\/li>\n<\/ul>\n<h2>Step 1: Update Your Server<\/h2>\n<p>First, update your package list and all the installed packages to ensure your system is up to date:<\/p>\n<pre><code>sudo apt update &amp;&amp; sudo apt upgrade -y<\/code><\/pre>\n<p>This will ensure that your server is secure and ready for the Ghost installation. Keeping your server updated is especially important for <a href=\"https:\/\/ie.netcloud24.com\">VPS server<\/a> environments.<\/p>\n<h2>Step 2: Install Nginx<\/h2>\n<p>Nginx is a popular and efficient web server. To install Nginx, run the following command:<\/p>\n<pre><code>sudo apt install nginx -y<\/code><\/pre>\n<p>Once installed, start and enable Nginx to run at boot:<\/p>\n<pre><code>\r\nsudo systemctl start nginx\r\nsudo systemctl enable nginx\r\n        <\/code><\/pre>\n<p>You can verify the installation by opening your server&#8217;s IP address in a browser. If everything is working correctly, you should see the default Nginx page.<\/p>\n<h2>Step 3: Install Node.js<\/h2>\n<p>Ghost runs on Node.js, so we need to install it. Add the Node.js repository and install the latest version of Node.js:<\/p>\n<pre><code>\r\ncurl -fsSL https:\/\/deb.nodesource.com\/setup_18.x | sudo -E bash -\r\nsudo apt install -y nodejs\r\n        <\/code><\/pre>\n<p>After the installation, verify the Node.js version:<\/p>\n<pre><code>node -v<\/code><\/pre>\n<p>Ensure that you have Node.js version 18.x or later installed.<\/p>\n<h2>Step 4: Install MySQL<\/h2>\n<p>Ghost requires a database, and MySQL is a common choice. Install MySQL with the following command:<\/p>\n<pre><code>sudo apt install mysql-server -y<\/code><\/pre>\n<p>After installation, start and enable the MySQL service:<\/p>\n<pre><code>\r\nsudo systemctl start mysql\r\nsudo systemctl enable mysql\r\n        <\/code><\/pre>\n<p>Run the following script to secure your MySQL installation:<\/p>\n<pre><code>sudo mysql_secure_installation<\/code><\/pre>\n<p>This will prompt you to configure security settings like the root password, removing anonymous users, and disabling remote root login.<\/p>\n<h2>Step 5: Create a MySQL Database for Ghost<\/h2>\n<p>Log into the MySQL shell to create a new database and user for Ghost:<\/p>\n<pre><code>sudo mysql -u root -p<\/code><\/pre>\n<p>Once logged in, run the following commands to create the database and user:<\/p>\n<pre><code>\r\nCREATE DATABASE ghost;\r\nCREATE USER 'ghostuser'@'localhost' IDENTIFIED BY 'your-strong-password';\r\nGRANT ALL PRIVILEGES ON ghost.* TO 'ghostuser'@'localhost';\r\nFLUSH PRIVILEGES;\r\nEXIT;\r\n        <\/code><\/pre>\n<p>Replace <code>your-strong-password<\/code> with a secure password.<\/p>\n<h2>Step 6: Install Ghost-CLI<\/h2>\n<p>Ghost-CLI is a command-line tool for installing and managing Ghost. Install Ghost-CLI globally by running:<\/p>\n<pre><code>sudo npm install -g ghost-cli@latest<\/code><\/pre>\n<p>Once installed, create a directory for Ghost:<\/p>\n<pre><code>\r\nsudo mkdir -p \/var\/www\/ghost\r\nsudo chown $USER:$USER \/var\/www\/ghost\r\ncd \/var\/www\/ghost\r\n        <\/code><\/pre>\n<h2>Step 7: Install Ghost<\/h2>\n<p>Now that Ghost-CLI is installed, we can install Ghost by running the following command in the Ghost directory:<\/p>\n<pre><code>ghost install<\/code><\/pre>\n<p>During installation, Ghost-CLI will prompt you to enter your domain name, configure SSL (using Let&#8217;s Encrypt), and set up the MySQL database details.<\/p>\n<h2>Step 8: Configure Nginx for Ghost<\/h2>\n<p>Ghost-CLI will automatically configure Nginx for you during the installation. If you ever need to manually restart Nginx or check its status, use the following commands:<\/p>\n<pre><code>\r\nsudo systemctl restart nginx\r\nsudo systemctl status nginx\r\n        <\/code><\/pre>\n<h2>Step 9: Access Your Ghost Blog<\/h2>\n<p>Once the installation is complete, open your browser and navigate to your domain name or server IP address. You should see your Ghost blog running. To access the admin panel, add <code>\/ghost<\/code> to your domain (e.g., <code>http:\/\/yourdomain.com\/ghost<\/code>).<\/p>\n<h2>Conclusion<\/h2>\n<p>Deploying Ghost with Nginx on Debian 12 is a straightforward process. With Nginx as the web server and MySQL as the database, Ghost offers a powerful platform for managing your content. Whether you&#8217;re running this setup on a local server or a <a href=\"https:\/\/ie.netcloud24.com\">VPS server<\/a>, you can now enjoy a professional, fast, and modern blogging experience. For reliable VPS hosting, visit <a href=\"https:\/\/ie.netcloud24.com\">netcloud24.com<\/a> for scalable and secure VPS solutions.<\/p>\n<\/section>\n<footer>\n<p>For more tutorials and VPS hosting solutions, visit <a href=\"https:\/\/ie.netcloud24.com\">netcloud24.com<\/a>.<\/p>\n<\/footer>\n<div class=\"post-author-box\" style=\"border-top:1px solid #ddd;margin-top:20px;padding-top:15px;\">\n<p><strong>Author:<\/strong> \u0141ukasz Bodziony<\/p>\n<p><strong>Website:<\/strong> <a href=\"https:\/\/ca.netcloud24.com\" target=\"_blank\" rel=\"dofollow\">Windows VPS<\/a><\/p>\n<p><em>\u0141ukasz Bodziony is the CEO and founder of <a href=\"https:\/\/netcloud24.com\" target=\"_blank\" rel=\"dofollow\">NETCLOUD24<\/a>, a global VPS hosting brand proudly originating from Poland. With extensive experience in cloud computing, virtualization, and server management, he delivers high-performance <strong>Windows VPS<\/strong> and <strong>Remote Desktop Services (RDS)<\/strong> solutions to clients across Europe, North America, and beyond.<\/em><\/p>\n<p><em>His expertise covers a wide range of technologies, including <strong>Microsoft Azure<\/strong>, <strong>Proxmox VE<\/strong>, <strong>Amazon Web Services (AWS)<\/strong>, and numerous other virtualization and cloud platforms.<\/em><\/p>\n<p><em>Beyond running his hosting business, \u0141ukasz also provides <strong>professional paid server configuration and optimization services<\/strong> for companies and individuals. Outside of work, he is dedicated to caring for his children and building a secure future for them.<\/em><\/p>\n<p><em>If you are interested in working with him or need expert assistance with your hosting, cloud environment, or server setup, feel free to reach out via <a href=\"https:\/\/ca.netcloud24.com\" target=\"_blank\" rel=\"dofollow\">Windows VPS<\/a>.<\/em><\/p>\n<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u00a0 \u00a0 Ghost is a popular open-source platform for professional bloggers, offering a simple and modern interface with powerful publishing tools. In this tutorial, we will go through\u2026<\/p>\n","protected":false},"author":1,"featured_media":3421,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_seopress_robots_primary_cat":"","_seopress_titles_title":"","_seopress_titles_desc":"","_seopress_robots_index":"","footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[],"tags":[14,12,11,23,20,21,22,17,7,8,6,10,18,19,15,24,16,5,13,9],"class_list":["post-2027","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","tag-cheapvps","tag-cloudvps","tag-hostingvps","tag-rds","tag-rdscal","tag-remotedesktop","tag-remotedesktopvps","tag-servervps","tag-ukvps","tag-virtualserver","tag-vpshosting","tag-vpsserver","tag-vpssolutions","tag-vpswindows","tag-vpswithwindows","tag-windowsrds","tag-windowsserver","tag-windowsvps","tag-windowsvpshosting","tag-windowsvpsuk"],"jetpack_publicize_connections":[],"_links":{"self":[{"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/2027","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/comments?post=2027"}],"version-history":[{"count":0,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/2027\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/media\/3421"}],"wp:attachment":[{"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/media?parent=2027"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/categories?post=2027"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/tags?post=2027"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}