Ghost is an open-source publishing platform built on Node.js. It is designed for bloggers, journalists, and independent publishers who want a fast, customizable platform they can self-host. Ghost handles content management, membership subscriptions, email newsletters, and SEO out of the box.
This guide covers how to install Ghost on Ubuntu 18.04 in production mode using MySQL as the database, Nginx as a reverse proxy, and a free Let’s Encrypt SSL certificate.
<strong>Prerequisites:</strong> You need sudo access (not root), a domain pointing to your server IP, Nginx installed, ports 80 and 443 open in your firewall, and at least 1 GB of RAM.
Install Node.js v8 LTS from the NodeSource repository. Ghost 1.x pins its Node.js compatibility tightly — a version mismatch causes the Ghost-CLI installer to fail. Node.js v8 “Carbon” LTS is the required version for this Ghost release:
bashcurl -sL https://deb.nodesource.com/setup_8.x | sudo bash -sudo apt install nodejs
Install Yarn. Ghost-CLI uses Yarn as its package manager:
bashcurl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.listsudo apt updatesudo apt-get -o Dpkg::Options::="--force-overwrite" install yarn
The --force-overwrite flag resolves conflicts between Yarn’s file structure and Ubuntu system package paths.
Install MySQL and change the root authentication method. Ghost’s database connector sends a username and password when connecting. MySQL 5.7’s default auth_socket plugin ignores that password and validates by matching the Linux username instead, which breaks Ghost’s database setup:
bashsudo apt install mysql-serversudo mysql_secure_installationsudo mysql
sqlALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'your-strong-password';FLUSH PRIVILEGES;
Install Ghost-CLI globally:
bashsudo yarn global add ghost-cli
Ghost-CLI is more than a one-time installer. After setup, you use ghost start, ghost stop, ghost restart, ghost log, and ghost ls to manage your installation.
Create the installation directory. Ghost must NOT be installed as root. Ghost-CLI checks for this and refuses to proceed:
bashsudo mkdir -p /var/www/ghostsudo chown $USER:$USER /var/www/ghostsudo chmod 775 /var/www/ghost
bashcd /var/www/ghostghost install
Ghost-CLI checks the system first and prints a warning about Ubuntu 16 compatibility. Type y to continue on Ubuntu 18.04. This warning is expected and does not indicate a real problem.
The installer then guides you through a series of prompts:
https://your-domain.comroot and the password you setghost_prodAfter the database setup, the installer creates a ghost system user automatically and asks if you want to create a ghost MySQL user. Answer Yes.
The installer then asks three more questions in sequence:
/etc/nginx/sites-enabled/ghost_example-com (Ghost uses your domain name as the service identifier, replacing dots with hyphens)The installer runs database migrations, starts Ghost, and enables the service on boot. It prints the admin URL at the end.
Open https://your-domain.com/ghost/ in a browser. Click Create your account, fill in the blog title, your name, email, and a strong password. The first account created has full administrator access — set this up before sharing your site URL.
On the next screen, invite collaborators by email or click I’ll do this later to go straight to the Ghost dashboard. From there you can write posts, manage users, install themes, and configure settings.
Useful Ghost-CLI commands for day-to-day management:
ghost ls: list all Ghost installations and their statusghost start / ghost stop / ghost restart: control the running instanceghost log: tail the Ghost error logghost update: upgrade to the latest Ghost versionGhost is now installed and running in production mode on Ubuntu 18.04. Visit the Ghost Help Center to explore advanced configuration like custom themes, member subscriptions, and email newsletters. Leave a comment below if you run into any issues.
Asterisk is the most widely deployed open-source PBX (Private Branch Exchange) platform in the world. It…
Mattermost is an open-source, self-hosted team messaging platform and a direct alternative to Slack. It is…
Ruby is a dynamic, open-source programming language known for its clean, readable syntax. It powers the…
PyCharm is a full-featured Python IDE developed by JetBrains. It includes built-in debugging, embedded Git control,…
PHP 8.5 is included in Ubuntu 26.04's default repositories and is the recommended version for…
Ubuntu 26.04 LTS "Resolute Raccoon" arrived on April 23, 2026 with Linux kernel 7.0, GNOME 50,…