{"id":1867,"date":"2026-09-05T09:35:39","date_gmt":"2026-09-05T04:05:39","guid":{"rendered":"https:\/\/cpanelfree.com\/blog\/how-to-install-ghost-cms-ubuntu-vps-mysql-nginx\/"},"modified":"2026-09-05T12:58:22","modified_gmt":"2026-09-05T07:28:22","slug":"how-to-install-ghost-cms-ubuntu-vps-mysql-nginx","status":"publish","type":"post","link":"https:\/\/cpanelfree.com\/blog\/how-to-install-ghost-cms-ubuntu-vps-mysql-nginx\/","title":{"rendered":"How to Install Ghost CMS on Ubuntu VPS with MySQL 8 and Nginx (Ultimate Publisher Guide)"},"content":{"rendered":"<h2>Why Professional Creators and Media Outlets Choose Ghost CMS<\/h2>\n<p>While WordPress remains the dominant CMS worldwide, modern creators, independent publishers, and digital media organizations frequently seek platforms engineered specifically for long-form publishing, paid member subscriptions, native email newsletters, and extreme speed. <strong>Ghost CMS<\/strong> is a lightning-fast, open-source publishing engine built on Node.js. Powered by the V8 JavaScript runtime and a clean markdown\/rich-text editor, Ghost delivers page loads up to 1,900% faster than traditional PHP-based CMS platforms.<\/p>\n<p>While managed Ghost(Pro) hosting charges $30 to $200+ monthly as subscriber counts scale, self-hosting Ghost CMS on an Ubuntu Cloud VPS gives you unlimited members, zero subscription revenue commissions, custom Handlebars themes, and total database sovereignty for just the raw VPS server cost.<\/p>\n<p>In this comprehensive enterprise tutorial, we will configure Node.js LTS, MySQL 8, and Ghost-CLI on Ubuntu 24.04\/22.04 LTS, provision a dedicated production database, automate SSL certificate generation, and configure transactional email deliverability via Mailgun or custom SMTP.<\/p>\n<h2>Step 1: Preparing Server Prerequisites &amp; Installing Node.js LTS<\/h2>\n<p>Ghost requires an unprivileged system user, active Node.js LTS (v18.x or v20.x), Nginx web server, and MySQL 8.0:<\/p>\n<pre><code># Update package repositories and install core dependencies\nsudo apt update &amp;&amp; sudo apt install -y curl git nginx certbot python3-certbot-nginx mysql-server\n\n# Install official NodeSource Node.js 20 LTS repository\ncurl -fsSL https:\/\/deb.nodesource.com\/setup_20.x | sudo -E bash -\nsudo apt install -y nodejs\n\n# Install the official Ghost-CLI management utility globally\nsudo npm install -g ghost-cli@latest<\/code><\/pre>\n<h2>Step 2: Installing and Hardening MySQL 8.0 for Ghost<\/h2>\n<p>Ghost requires native MySQL 8.0 for relational schema management and member subscription handling. Create a dedicated database and user with native password authentication:<\/p>\n<pre><code># Access MySQL root console\nsudo mysql &lt;&lt; 'EOF'\nCREATE DATABASE ghost_production DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;\nCREATE USER 'ghost_user'@'127.0.0.1' IDENTIFIED WITH mysql_native_password BY 'UltraSecretGhostPass2026!';\nGRANT ALL PRIVILEGES ON ghost_production.* TO 'ghost_user'@'127.0.0.1';\nFLUSH PRIVILEGES;\n\\q\nEOF<\/code><\/pre>\n<h2>Step 3: Creating Production Directory and Ghost System User<\/h2>\n<p>Ghost-CLI strictly prohibits running installations as the <code>root<\/code> user. Create a dedicated administrative user or execute under a standard sudo user:<\/p>\n<pre><code># Create webroot directory\nsudo mkdir -p \/var\/www\/ghost\nsudo chown -R $USER:$USER \/var\/www\/ghost\nsudo chmod 775 \/var\/www\/ghost\n\n# Navigate to project root\ncd \/var\/www\/ghost<\/code><\/pre>\n<h2>Step 4: Automated Ghost Production Installation via Ghost-CLI<\/h2>\n<p>Ghost-CLI automates the entire stack setup\u2014downloading Ghost core, running database migrations, configuring systemd daemons, generating Nginx virtual hosts, and provisioning Let&#8217;s Encrypt SSL certificates:<\/p>\n<pre><code># Launch interactive Ghost installation wizard\nghost install<\/code><\/pre>\n<h3>Ghost-CLI Configuration Prompts:<\/h3>\n<ul>\n<li><strong>Blog URL:<\/strong> <code>https:\/\/publish.example.com<\/code> (Must include <code>https:\/\/<\/code>)<\/li>\n<li><strong>MySQL hostname:<\/strong> <code>127.0.0.1<\/code><\/li>\n<li><strong>MySQL username:<\/strong> <code>ghost_user<\/code><\/li>\n<li><strong>MySQL password:<\/strong> <code>UltraSecretGhostPass2026!<\/code><\/li>\n<li><strong>Ghost database name:<\/strong> <code>ghost_production<\/code><\/li>\n<li><strong>Set up a ghost mysql user?<\/strong> No (We already configured it)<\/li>\n<li><strong>Set up Nginx?<\/strong> Yes<\/li>\n<li><strong>Set up SSL?<\/strong> Yes (Enter your administrative email for Let&#8217;s Encrypt notices)<\/li>\n<li><strong>Set up systemd?<\/strong> Yes<\/li>\n<li><strong>Start Ghost?<\/strong> Yes<\/li>\n<\/ul>\n<h2>Step 5: Configuring Transactional Email Delivery for Newsletters<\/h2>\n<p>Ghost features native email newsletter distribution. Configure your SMTP or Mailgun credentials in <code>\/var\/www\/ghost\/config.production.json<\/code>:<\/p>\n<pre><code>\"mail\": {\n  \"transport\": \"SMTP\",\n  \"options\": {\n    \"service\": \"Mailgun\",\n    \"host\": \"smtp.mailgun.org\",\n    \"port\": 587,\n    \"secure\": false,\n    \"auth\": {\n      \"user\": \"postmaster@publish.example.com\",\n      \"pass\": \"YourMailgunSmtpKeyHere\"\n    }\n  }\n}<\/code><\/pre>\n<p>Apply configuration changes by running <code>ghost restart<\/code>.<\/p>\n<h2>Ghost CMS Performance &amp; Architectural Matrix<\/h2>\n<table style=\"width: 100%;border-collapse: collapse;margin: 20px 0;border: 1px solid #334155\">\n<thead>\n<tr style=\"background-color: #0f172a;color: #38bdf8\">\n<th style=\"padding: 12px;border: 1px solid #334155\">Layer<\/th>\n<th style=\"padding: 12px;border: 1px solid #334155\">Component<\/th>\n<th style=\"padding: 12px;border: 1px solid #334155\">Operational Role<\/th>\n<th style=\"padding: 12px;border: 1px solid #334155\">Advantage<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr style=\"background-color: #1e293b;color: #f8fafc\">\n<td style=\"padding: 10px;border: 1px solid #334155\"><strong>Application Engine<\/strong><\/td>\n<td style=\"padding: 10px;border: 1px solid #334155\">Node.js V8 Runtime<\/td>\n<td style=\"padding: 10px;border: 1px solid #334155\">Ghost Core &amp; API<\/td>\n<td style=\"padding: 10px;border: 1px solid #334155\">Non-blocking asynchronous I\/O<\/td>\n<\/tr>\n<tr style=\"background-color: #0f172a;color: #f8fafc\">\n<td style=\"padding: 10px;border: 1px solid #334155\"><strong>Database Engine<\/strong><\/td>\n<td style=\"padding: 10px;border: 1px solid #334155\">MySQL 8.0 InnoDB<\/td>\n<td style=\"padding: 10px;border: 1px solid #334155\">Posts, Members, Payments<\/td>\n<td style=\"padding: 10px;border: 1px solid #334155\">ACID transaction safety<\/td>\n<\/tr>\n<tr style=\"background-color: #1e293b;color: #f8fafc\">\n<td style=\"padding: 10px;border: 1px solid #334155\"><strong>Edge Reverse Proxy<\/strong><\/td>\n<td style=\"padding: 10px;border: 1px solid #334155\">Nginx + SSL<\/td>\n<td style=\"padding: 10px;border: 1px solid #334155\">Static asset cache &amp; HTTP\/2<\/td>\n<td style=\"padding: 10px;border: 1px solid #334155\">Sub-25ms response speeds<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Essential Ghost-CLI Management Commands<\/h2>\n<ul>\n<li><code>ghost status<\/code>: Inspect active port, process ID, and systemd daemon health.<\/li>\n<li><code>ghost restart<\/code>: Restart Node.js application process without dropping web connections.<\/li>\n<li><code>ghost update<\/code>: Automatically backup database and upgrade Ghost core to the newest release.<\/li>\n<li><code>ghost log -f<\/code>: Stream real-time access and error logs.<\/li>\n<\/ul>\n<h2>Automating Ghost Backups with Ghost-CLI and Crontab<\/h2>\n<p>While Ghost stores published images and uploaded media assets under <code>\/var\/www\/ghost\/content\/images\/<\/code>, all subscriber lists, post revisions, and member settings live in MySQL. Automate daily offsite backups with this automated cron script:<\/p>\n<pre><code># Automated Ghost Backup Script (\/usr\/local\/bin\/backup-ghost.sh)\n#!\/bin\/bash\nset -e\nDATE=$(date +%Y%m%d_%H%M%S)\nBACKUP_DIR=\"\/var\/backups\/ghost\/$DATE\"\nmkdir -p $BACKUP_DIR\n\n# Export MySQL database\nmysqldump -u ghost_user -p'UltraSecretGhostPass2026!' ghost_production | gzip &gt; $BACKUP_DIR\/ghost_db.sql.gz\n\n# Archive uploaded images and themes\ntar -czvf $BACKUP_DIR\/ghost_content.tar.gz -C \/var\/www\/ghost\/content images themes\n\n# Prune old archives (&gt; 30 days)\nfind \/var\/backups\/ghost\/ -type d -mtime +30 -exec rm -rf {} +\necho \"Ghost automated backup completed successfully!\"<\/code><\/pre>\n<h2>Ghost Troubleshooting &amp; Maintenance Playbook<\/h2>\n<table style=\"width: 100%;border-collapse: collapse;margin: 20px 0;border: 1px solid #334155\">\n<thead>\n<tr style=\"background-color: #0f172a;color: #38bdf8\">\n<th style=\"padding: 12px;border: 1px solid #334155\">Issue \/ Symptom<\/th>\n<th style=\"padding: 12px;border: 1px solid #334155\">Root Cause<\/th>\n<th style=\"padding: 12px;border: 1px solid #334155\">Resolution Action<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr style=\"background-color: #1e293b;color: #f8fafc\">\n<td style=\"padding: 10px;border: 1px solid #334155\">Ghost process crashing on start<\/td>\n<td style=\"padding: 10px;border: 1px solid #334155\">Node.js version mismatch or port 2368 conflict<\/td>\n<td style=\"padding: 10px;border: 1px solid #334155\">Verify with <code>ghost doctor<\/code> and check <code>ghost log<\/code><\/td>\n<\/tr>\n<tr style=\"background-color: #0f172a;color: #f8fafc\">\n<td style=\"padding: 10px;border: 1px solid #334155\">502 Bad Gateway on publish URL<\/td>\n<td style=\"padding: 10px;border: 1px solid #334155\">Systemd daemon stopped or memory limit reached<\/td>\n<td style=\"padding: 10px;border: 1px solid #334155\">Run <code>ghost restart<\/code> and inspect <code>systemctl status ghost_*<\/code><\/td>\n<\/tr>\n<tr style=\"background-color: #0f172a;color: #f8fafc\">\n<td style=\"padding: 10px;border: 1px solid #334155\">Newsletter emails failing to deliver<\/td>\n<td style=\"padding: 10px;border: 1px solid #334155\">Missing Mailgun API key or unverified domain DNS<\/td>\n<td style=\"padding: 10px;border: 1px solid #334155\">Verify SPF, DKIM, and MX records in Mailgun portal<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div style=\"background-color: #0f172a;border-left: 4px solid #38bdf8;padding: 18px 24px;margin: 30px 0;border-radius: 8px\">\n<h3 style=\"color: #38bdf8;margin-top: 0\">Recommended Related Technical Guides<\/h3>\n<ul style=\"margin-bottom: 0;color: #cbd5e1\">\n<li><a href=\"https:\/\/cpanelfree.com\/blog\/how-to-deploy-nodejs-express-app-linux-vps-nginx-pm2\/\" style=\"color: #38bdf8;text-decoration: underline\">Deploying Node.js Applications with PM2 and Nginx<\/a><\/li>\n<li><a href=\"https:\/\/cpanelfree.com\/blog\/how-to-optimize-mysql-mariadb-high-traffic-vps\/\" style=\"color: #38bdf8;text-decoration: underline\">Optimizing MySQL 8 InnoDB Buffers for High-Traffic VPS<\/a><\/li>\n<li><a href=\"https:\/\/cpanelfree.com\/blog\/how-to-setup-cloudflare-cdn-full-page-caching-wordpress\/\" style=\"color: #38bdf8;text-decoration: underline\">Setting Up Cloudflare Edge Caching for Maximum Speed<\/a><\/li>\n<\/ul>\n<\/div>\n<div style=\"background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);color: #ffffff;padding: 28px;border-radius: 12px;margin: 35px 0;text-align: center\">\n<h3 style=\"color: #ffffff;margin-top: 0;font-size: 22px\">Launch Lightning-Fast Ghost CMS on CpanelFree Cloud VPS<\/h3>\n<p style=\"color: #e0f2fe;font-size: 15px;max-width: 650px;margin: 0 auto 18px auto\">Scale your publication and newsletter with pure NVMe storage, dedicated memory, and 100% free hosting and VPS options.<\/p>\n<p>  <a href=\"https:\/\/cpanelfree.com\/\" style=\"background-color: #ffffff;color: #0284c7;font-weight: 700;padding: 12px 28px;border-radius: 8px;text-decoration: none;display: inline-block\">Get Free Cloud Hosting Today &rarr;<\/a>\n<\/div>\n<div style=\"border-left: 4px solid #38bdf8;border-radius: 8px;padding: 20px;margin: 30px 0\">\n<h3 style=\"margin-top: 0;color: #38bdf8;font-size: 18px;display: flex;align-items: center\">\n        <span style=\"margin-right: 8px\">\ud83d\udd17<\/span> Recommended Related Technical Guides:<br \/>\n    <\/h3>\n<ul style=\"margin: 10px 0 0 0;padding-left: 20px;line-height: 1.8\">\n<li><a href=\"https:\/\/cpanelfree.com\/blog\/free-cpanel-hosting-php-mysql-support\/\" style=\"color: #38bdf8;text-decoration: none;font-weight: 600\">Top 7 Best Free cPanel Hosting Providers with PHP 8.3 &amp; MySQL Support<\/a><\/li>\n<li><a href=\"https:\/\/cpanelfree.com\/blog\/how-to-export-import-large-mysql-database-command-line\/\" style=\"color: #38bdf8;text-decoration: none;font-weight: 600\">How to Export and Import Large MySQL Databases via Command Line (No Timeout)<\/a><\/li>\n<li><a href=\"https:\/\/cpanelfree.com\/blog\/how-to-increase-phpmyadmin-upload-file-size-limit\/\" style=\"color: #38bdf8;text-decoration: none;font-weight: 600\">How to Increase phpMyAdmin Upload File Size Limit in cPanel &amp; Linux VPS<\/a><\/li>\n<li><a href=\"https:\/\/cpanelfree.com\/blog\/how-to-host-multiple-websites-free-hosting\/\" style=\"color: #38bdf8;text-decoration: none;font-weight: 600\">How to Host Multiple Websites on a Single Free Hosting Account<\/a><\/li>\n<li><a href=\"https:\/\/cpanelfree.com\/#plans\" style=\"color: #10b981;text-decoration: none;font-weight: 600\">Explore $0 Free cPanel Web Hosting Plans (NVMe SSD, AutoSSL)<\/a><\/li>\n<\/ul>\n<\/div>\n<div style=\"background: linear-gradient(135deg, rgba(6, 182, 212, 0.15) 0%, rgba(59, 130, 246, 0.15) 100%);border-radius: 12px;padding: 25px;margin: 30px 0;text-align: center\">\n<h3 style=\"color: #38bdf8;margin-top: 0;font-size: 20px\">Deploy Fast, Reliable Web Hosting on CpanelFree<\/h3>\n<p style=\"color: #94a3b8;font-size: 14px;line-height: 1.6;max-width: 600px;margin: 0 auto 15px\">\n        Get genuine cPanel control, unmetered NVMe SSD storage, and free AutoSSL at $0 cost forever.\n    <\/p>\n<p>    <a href=\"https:\/\/cpanelfree.com\/#plans\" style=\"display: inline-block;background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);color: #ffffff;padding: 10px 22px;border-radius: 6px;text-decoration: none;font-weight: bold;font-size: 14px\">Claim Free Hosting Account<\/a>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Why Professional Creators and Media Outlets Choose Ghost CMS While WordPress remains the dominant CMS worldwide, modern creators, independent publishers, and digital media organizations frequently seek platforms engineered specifically for long-form publishing, paid member subscriptions, native email newsletters, and extreme speed. Ghost CMS is a lightning-fast, open-source publishing engine built on Node.js. Powered by the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":2500,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[163],"tags":[],"class_list":["post-1867","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-databases"],"_links":{"self":[{"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/posts\/1867","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/comments?post=1867"}],"version-history":[{"count":2,"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/posts\/1867\/revisions"}],"predecessor-version":[{"id":2300,"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/posts\/1867\/revisions\/2300"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/media\/2500"}],"wp:attachment":[{"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/media?parent=1867"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/categories?post=1867"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/tags?post=1867"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}