How to Self-Host a Ghost Blog: A Complete Step-by-Step Guide
Everything you need to install, secure, and maintain a self-hosted Ghost publication on your own server — plus how to decide whether self-hosting is the right call.
Contents
OverviewAt a glancePricingPros & consSelf-hosting vs. Ghost(Pro): which should you choose?What you need before you start (official requirements)Step 1 — Prepare your serverStep 2 — Install Ghost-CLI and run the installerStep 3 — Configure email (newsletters and transactional)Step 4 — Ongoing maintenance: updates, backups, and securityCommon problems and how to avoid themVerdictSourcesGhost is an open-source publishing platform built on Node.js, and one of its biggest advantages is that you can run it on your own server for free instead of paying for managed hosting. Self-hosting gives you complete control over your data, your costs, and your configuration — but it also means you become responsible for the server, security, updates, and email deliverability.
This guide walks through the entire process the way Ghost's own documentation recommends: choosing a server, installing the official production stack (NGINX, MySQL 8, Node.js, and Ghost-CLI), running the installer, configuring SSL and email, and keeping the site healthy over time. It assumes you are comfortable working on a Linux command line. Because requirements and supported versions change between releases, treat the version numbers below as a starting point and confirm the current details in Ghost's official docs before you begin.
At a glance
Short answer: Spin up a small Ubuntu VPS (1GB+ RAM), install NGINX, MySQL 8, and a Ghost-supported Node.js version, then let the official Ghost-CLI do the heavy lifting with ghost install — it configures NGINX, a free Let's Encrypt SSL certificate, and a systemd service automatically. Budget time for email setup (Mailgun for newsletters), regular backups, and updates via ghost update. If you'd rather not run a server, Ghost(Pro) is the official managed alternative.
Pricing
Confirm current pricing on each vendor's site.
- Ghost software is free and open source (MIT licensed)
- Runs on an entry-level Ubuntu VPS with 1GB+ RAM
- You pay only for the server, domain, and any email service (e.g. Mailgun)
- Maximum control, but you handle all maintenance
- Fully managed hosting with automatic updates, backups, SSL, and CDN
- Tiers scale by staff users, custom themes, and member/email volume
- Official support from the Ghost team
- Revenue directly funds open-source Ghost development
Pros & cons
- Full control over your data, configuration, and integrations
- Lowest recurring cost — typically just a VPS and a domain
- No platform-imposed limits on storage, members, or custom code
- Freedom to use any theme, integration, or server tweak
- Your content and setup are fully portable
- You are responsible for server setup, security, and updates
- You must configure and maintain email/deliverability yourself (Mailgun for newsletters)
- Backups, uptime, and scaling are your responsibility
- Requires comfort with the Linux command line
- Troubleshooting falls on you rather than a support team
- No server maintenance — updates, backups, SSL, and CDN are handled
- Fast setup with no command-line work
- Official support from the Ghost team
- Subscription revenue funds the open-source project
- Higher recurring cost than a budget VPS
- Pricing scales with members, staff, and email volume
- Less low-level control over the server
- Some customization is restricted on lower tiers
Self-hosting vs. Ghost(Pro): which should you choose?
Ghost is released as free, open-source software (MIT licensed), so you can install it on any compatible server at no licensing cost. The company behind it also offers Ghost(Pro), an official managed hosting service whose revenue funds ongoing development of the open-source project.
Self-hosting makes sense when you want maximum control and the lowest possible recurring bill, and you're willing to maintain a Linux server. You'll handle the operating system, web server, database, SSL renewal, backups, and software updates yourself.
Ghost(Pro) makes sense when you'd rather spend your time writing than administering servers. Updates, backups, SSL, and a CDN are handled for you, and you get official support. The trade-off is a higher recurring cost than a cheap VPS and less low-level control. The rest of this guide focuses on the self-hosted path.
What you need before you start (official requirements)
Ghost's documentation recommends a specific production stack. Gather the following before installing:
- A server / VPS running a currently supported Ubuntu LTS release. A fresh, dedicated server is best.
- At least 1GB of RAM (plus swap). Installs frequently fail on 512MB servers, so add swap if memory is tight.
- A non-root user with sudo privileges. Ghost should never be installed as the root user.
- A registered domain with an A record pointed at your server's public IP address, configured before you request an SSL certificate.
- The production software stack: NGINX (as the web server / reverse proxy), MySQL 8, a Ghost-supported version of Node.js, systemd (for process management), and Ghost-CLI (the official installer and management tool).
Two version notes that trip people up: production installs require MySQL 8 — SQLite is intended only for local development. And Node.js must be a version Ghost currently supports; the supported list changes as Node's LTS cycle moves on, so check Ghost's supported-versions reference rather than just installing the newest Node.
Step 1 — Prepare your server
Connect to your server over SSH and get the base system ready. The exact commands vary slightly by Ubuntu version, but the sequence is consistent:
- Update the system: run sudo apt update and sudo apt upgrade so all packages are current.
- Create a dedicated user and grant it sudo access, then log in as that user. Do not run the rest of the install as root.
- Install NGINX (sudo apt install nginx) and allow web traffic through your firewall (for example, sudo ufw allow 'Nginx Full').
- Install MySQL 8 (sudo apt install mysql-server) and secure it. Note the root password you set — Ghost-CLI will ask for database credentials.
- Install Node.js from the official NodeSource repository, choosing a Ghost-supported version. Installing from NodeSource (rather than Ubuntu's default repo) ensures you get a current, supported release.
Many hosts also offer a one-click Ghost image (for example, on DigitalOcean) that pre-installs this stack. That's a convenient shortcut, but understanding the manual steps makes troubleshooting far easier later.
Step 2 — Install Ghost-CLI and run the installer
Ghost-CLI is the official command-line tool that installs, configures, and manages a self-hosted Ghost site. Install it globally with npm:
- sudo npm install ghost-cli@latest -g
Next, create a directory for your site, give your user ownership, and move into it — for example a folder under /var/www/ named after your site. Then run the installer from inside that directory:
- ghost install
The installer is interactive and walks you through the parts that are easy to get wrong. It will ask for your blog URL, your MySQL credentials, and whether to set up NGINX, configure SSL, and install a systemd service. When you accept those prompts, Ghost-CLI automatically:
- Creates the NGINX virtual host (the reverse proxy in front of Ghost).
- Requests and installs a free Let's Encrypt SSL certificate and sets up automatic renewal.
- Creates a systemd service so Ghost starts on boot and restarts if it crashes.
- Configures the database connection and starts the site.
When it finishes, visit https://yourdomain.com/ghost/ to create your admin account and your first post.
Step 3 — Configure email (newsletters and transactional)
Email is the step new self-hosters most often skip — and it matters, because Ghost relies on email for core features. There are two distinct kinds:
- Transactional email — password resets, staff invites, and member sign-in links. You can configure this with any SMTP provider in Ghost's configuration file or during setup.
- Bulk email / newsletters — sending posts to your subscribers. Ghost's documentation integrates newsletter sending with Mailgun, so to send newsletters you'll need a Mailgun account, a verified sending domain, and an API key.
You can set these values through Ghost Admin's settings or in your config.production.json file (managed via ghost config). Configuring a proper sending domain with SPF and DKIM records is what keeps your emails out of spam folders, so don't rely on a default no-reply address for anything important.
Step 4 — Ongoing maintenance: updates, backups, and security
The real work of self-hosting is what happens after launch. Build these habits in from day one:
Updates
Update Ghost itself with ghost update, run from your site directory. If an update causes problems, ghost update --rollback reverts to the previous version. Separately, keep the underlying server patched (Ubuntu packages, Node.js, MySQL) on a regular schedule.
Backups
A complete backup has three parts: export your content as JSON from Ghost Admin (under Settings), back up the MySQL database, and back up the content/ directory, which holds your uploaded images, themes, and configuration. The JSON export alone does not include your images, so don't treat it as a full backup.
Security and health
Use SSH keys instead of passwords, keep your firewall enabled, and consider a tool like fail2ban. Useful Ghost-CLI commands for day-to-day operations include ghost ls (list installed instances), ghost doctor (diagnose configuration issues), ghost log (view logs), and ghost restart.
Common problems and how to avoid them
- Not enough memory: installs fail or Ghost crashes on under-provisioned servers. Use at least 1GB of RAM and add swap on small instances.
- Unsupported Node.js version: installing the newest Node instead of a Ghost-supported release is a frequent cause of failed installs. Check Ghost's supported-versions list first.
- Using SQLite in production: SQLite is for local development only — production requires MySQL 8.
- Running the installer as root: Ghost-CLI will warn you. Always install and manage Ghost as a non-root user with sudo.
- Requesting SSL before DNS is ready: point your domain's A record at the server and let it propagate before running the install, or the Let's Encrypt step will fail.
- Skipping email configuration: without a properly configured SMTP/Mailgun setup, member sign-ins and newsletters won't work reliably.
Self-hosting Ghost is well within reach for anyone comfortable with a Linux terminal, largely because Ghost-CLI automates the parts that are easiest to get wrong — web server configuration, SSL certificates, and process management. The real ongoing cost isn't money; it's the responsibility for updates, security patching, backups, and email deliverability.
Choose self-hosting if you want maximum control and the lowest hosting bill and you're willing to maintain a server. If your time is better spent writing than administering Linux, the official Ghost(Pro) service removes the maintenance burden and funds the project's development. Whichever path you take, confirm the current system requirements, supported Node.js versions, and pricing on Ghost's official documentation before you start, since these details change over time.