How to Install Ghost: Each Method Step by Step

Install Ghost on Ghost(Pro), with Ghost's Docker Compose setup, with Ghost-CLI on Ubuntu, or on your own computer: what each needs and the steps to follow.

Luxe Themes Updated 17 min read

How you install Ghost depends mostly on who will run the server. Ghost(Pro), the hosting service run by the Ghost team, suits anyone who would rather write than look after one. Ghost’s own Docker Compose setup suits a new site on a server you rent. Ghost-CLI, Ghost’s older installer for Ubuntu servers, suits a site that already runs on it. A local install on your own computer suits building or testing a theme, and nothing else.

For each method, this page lists what you need and the exact steps. Then it covers installing a theme and the settings worth visiting first. We checked every step against Ghost’s documentation and code in September 2026, and ran the local install ourselves. Whether to self-host at all, and how to keep a server healthy once Ghost runs on it, is covered in our guide to self-hosting Ghost. Where to host and what it costs is in Ghost hosting options compared.

Which install method fits you

MethodWho it suitsWhat you need
Ghost(Pro)Anyone who wants to publish without running a serverAn email address, and possibly a card for the free trial
Ghost’s Docker Compose setupA new self-hosted siteA Linux server with Docker, a domain, an SMTP service for email
Ghost-CLI on UbuntuA self-hosted site that already uses itAn Ubuntu server and a domain; the steps install the rest
Local installBuilding or testing a themeA computer with a current Node 22 release

For a server of your own, prefer the Docker Compose setup: it is the method Ghost is moving to, and it brings its own database and web server, so there is less to install by hand.

Both self-hosted methods assume you are comfortable typing commands on a Linux server. If you are not, that is a reason to choose Ghost(Pro) rather than a server of your own.

Ghost(Pro): sign up and start writing

Ghost(Pro) is Ghost’s own hosting service. There is nothing to install: you create an account, and Ghost runs the software and the server for you.

  1. Open Ghost’s sign-up page. Every “Try for free” button on Ghost’s pricing page leads to the same form, and you do not choose a plan at this point.
  2. Enter your name, your email address and a password of at least 10 characters, then continue.
  3. Name your publication. The name can be up to 63 characters, without special characters.
  4. If Ghost asks for a card to start the trial, add one. We checked this against the sign-up page’s code rather than by creating an account, so the step may not appear.
  5. Wait about a minute while Ghost creates the site. It starts on Source, Ghost’s default theme.

Your new site lives at a free address such as yoursite.ghost.io, and its admin is at /ghost on that address. The ghost.io name can be changed later under Ghost(Pro) → Domain.

Every new account starts on a 14-day free trial. Ghost does not charge you when it ends, but to keep the site you choose a plan under Ghost(Pro) → Billing in the admin. Only the site owner can see that section. One limit is worth knowing before you choose: the Starter plan runs only Ghost’s built-in default theme, and uploading any other theme needs Publisher or above.

To use your own domain, add a CNAME record at your domain provider, which is a DNS entry that points your domain at the ghost.io address. Then connect it under Ghost(Pro) → Domain → Setup. Ghost issues the SSL certificate on its own. Our custom domain guide has the exact records for www, root and other subdomains.

From here, Ghost(Pro) works like every other method: install a theme if you want one, then work through the first settings, both further down this page.

Self-hosted with Ghost’s Docker Compose setup

Docker runs each piece of software in its own container, a packaged environment with everything that program needs. Docker Compose starts a group of containers from one configuration file. Ghost publishes that configuration in a public repository called ghost-docker. It runs Ghost, a MySQL database, and Caddy, a web server that takes care of the SSL certificate for you.

Ghost’s documentation still labels this setup a preview. We would use it for a new site anyway, for two reasons. Ghost has announced that it becomes the official method with Ghost 7. And it is the only way to run Ghost’s web analytics or your own ActivityPub server, both optional extras you can switch on later.

What you need

Two terms come up here. An A record is the DNS entry that connects a domain name to a server’s IP address. An SMTP service is an email account that software can send through, from any email provider that offers one.

WhatDetails
A Linux serverGhost’s own example has 2 GB of memory and one CPU.
DockerVersion 20.10.13 or later. Step 1 covers installing it.
A domainWith an A record pointing at the server. Set it up before you start, so the certificate can be issued as soon as the setup starts.
An SMTP serviceFor sign-in emails, staff invitations and password resets.
A Tinybird accountOptional. Only Ghost’s web analytics needs it.

1. Install Docker

Follow Docker’s installation instructions for your Linux distribution. Then check that both of these commands answer with a version number.

Terminal window
docker --version
docker compose version

For the technical reader: Ghost’s compose file uses the required flag on service dependencies, which needs Docker Compose 2.20.0 or later. The second command above shows which version you have.

2. Download the setup and fill in the settings

Download Ghost’s setup into its own folder, then make your own copies of the two example files:

Terminal window
git clone https://github.com/TryGhost/ghost-docker.git /opt/ghost && cd /opt/ghost
cp .env.example .env
cp caddy/Caddyfile.example caddy/Caddyfile

The file that matters now is the settings file, .env. It is plain text, one setting per line, and you can edit it with any text editor on the server. Change these and leave the rest as it is:

SettingWhat to put there
DOMAINYour site’s domain without https, such as example.com or www.example.com.
ADMIN_DOMAINOptional, and commented out by default. A separate address for the admin, such as admin.example.com. It also needs its block in the Caddyfile uncommented.
DATABASE_ROOT_PASSWORDA long random password.
DATABASE_PASSWORDA second long random password.
The lines starting mail__Your SMTP service’s host, port, username, password and the “from” address.
HTTP_PORT, HTTPS_PORTLeave at 80 and 443 unless something else on the server already uses those ports, or another proxy sits in front of Ghost.

Ghost’s documentation suggests generating each password with this command. Run it twice and paste one result into each password line:

Terminal window
openssl rand -hex 32

Set the database passwords once, because they must not change after the first start. The database keeps the original passwords, so changing them in .env later only breaks the connection between Ghost and its database.

The remaining lines are for later. The ActivityPub, Tinybird and profile settings switch on the optional extras. The version setting holds Ghost at a specific release, and the two data locations say where your content and database are stored on the server.

3. Choose between www and the bare domain

Most sites answer on one address, either example.com or www.example.com, and redirect the other to it. The Caddyfile you copied has commented-out blocks for this. Commented out means each line starts with a # and is ignored until you remove it.

If your domain setting is the bare domain, uncomment the block labelled “Redirect www -> root domain”. Uncommented, it looks like this.

# Redirect www -> root domain
www.{$DOMAIN} {
import snippets/Logging
redir https://{$DOMAIN}{uri}
}

If your domain setting starts with www, uncomment the “Redirect root -> www domain” block instead, and replace CHANGE_ME with your domain without the www. Ghost’s documentation notes that this redirect is required for ActivityPub to work on a www domain. Either way, both names need DNS records pointing at the server. Leave everything else in the Caddyfile alone; it reads your domain from .env.

4. Start Ghost and create your account

Terminal window
docker compose pull
docker compose up -d

The first command downloads Ghost, MySQL and Caddy, and can take a little while. The second starts them in the background. Open your domain in a browser to see the site, then add /ghost to the address to create the owner account.

When the site does not load

Docker keeps a log for each part of the setup. Start with Caddy’s, especially if the browser says the site can’t be reached, because Caddy is the part that answers the browser. Then read Ghost’s.

Terminal window
docker compose logs caddy
docker compose logs ghost

If you fix something in .env, the Ghost container has to be recreated before it sees the change. If you changed the domain or admin domain, recreate Caddy too, as in the second command.

Terminal window
# after changing a setting in .env
docker compose up -d --force-recreate ghost
# after changing DOMAIN or ADMIN_DOMAIN
docker compose up -d --force-recreate ghost caddy

New installs use Ghost’s hosted ActivityPub service by default, so the social web features work without extra steps, within that service’s limits. Our Ghost ActivityPub guide explains those limits, and Ghost’s Docker documentation has the steps for analytics and a self-hosted ActivityPub server.

Self-hosted on Ubuntu with Ghost-CLI

Ghost-CLI is Ghost’s command-line installer. On an Ubuntu server it installs Ghost, configures the NGINX web server and requests a free Let’s Encrypt SSL certificate. It also sets Ghost up as a system service, so it keeps running in the background. For most of Ghost’s history this was the standard way to self-host.

That is changing. Ghost has announced that Ghost 6 is the last major version that works with Ghost-CLI. When Ghost 7 arrives, the Docker Compose setup becomes the official method and Ghost-CLI receives security fixes only. There is no Ghost 7 release yet. The steps below are for maintaining or rebuilding a site that already runs this way.

What you need

WhatDetails
A serverUbuntu 22.04, 24.04 or 26.04, with at least 1 GB of memory.
A domainWith an A record already pointing at the server, so the certificate can be set up during the install.
Installed in the steps belowNGINX 1.9.5 or later, MySQL 8.0 or 8.4, a current Node 22 release, and Ghost-CLI.

1. Create a user that is not root

Ghost-CLI will not run as the root user; it stops with the message “You can’t run commands as the ‘root’ user” and exits. It also refuses a user named ghost, because that name conflicts with Ghost-CLI. So the first step is an ordinary user with administrator rights, under any other name:

Terminal window
ssh root@your_server_ip
adduser <user>
usermod -aG sudo <user>
su - <user>

2. Update the server and install NGINX

Terminal window
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install nginx
sudo ufw allow 'Nginx Full'

The last line opens the firewall for web traffic. It only matters if the server’s firewall is switched on.

3. Install MySQL and give root a password

On Ubuntu, MySQL’s root user signs in through the operating system rather than with a password, and Ghost cannot connect that way. So after installing MySQL you give root a password:

Terminal window
sudo apt-get install mysql-server
sudo mysql

Then, at the MySQL prompt:

ALTER USER 'root'@'localhost' IDENTIFIED WITH 'caching_sha2_password' BY '<your-new-root-password>';
FLUSH PRIVILEGES;
exit

For the technical reader: many older guides use mysql_native_password here. MySQL 8.4 disables that plugin by default, so the older command can fail on a current server. The line above is the one in Ghost’s own guide.

4. Install Node

Ghost’s guide installs Node system-wide from NodeSource’s package repository, and its documentation warns that other setups may run into problems:

Terminal window
sudo apt-get update
sudo apt-get install -y ca-certificates curl gnupg
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
NODE_MAJOR=22
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list
sudo apt-get update
sudo apt-get install nodejs -y
node --version

The last command prints the installed version. The latest Ghost needed 22.23.1 or newer when we checked in September 2026. Each Ghost release sets its own minimum within Node 22, and it has risen more than once during Ghost 6, so match Node to the release you install. Recent releases also accept Node 24, though Ghost’s documentation still lists Node 22 only.

5. Install Ghost-CLI and run the installer

Ghost-CLI is installed once for the whole server. Ghost itself goes in its own folder, owned by the user you created. Replace sitename and user with your own names:

Terminal window
sudo npm install ghost-cli@latest -g
sudo mkdir -p /var/www/sitename
sudo chown <user>:<user> /var/www/sitename
sudo chmod 775 /var/www/sitename
cd /var/www/sitename
ghost install

What the installer asks

The installer asksWhat to answer
Blog URLThe full address with https, such as https://example.com. An IP address causes errors.
MySQL hostnamePress Enter to accept localhost, since MySQL is on the same server.
MySQL username and passwordroot, and the password you set in step 3.
Ghost database nameAny name. Ghost creates the database for you when you connect as root.
Set up a ghost MySQL user?Yes. Ghost gets its own database user that can only reach its own database.
Set up NGINX?Yes.
Set up SSL?Yes. It asks for an email address, which receives notices about the certificate.
Set up systemd?Yes. This keeps Ghost running as a system service.
Start Ghost?Yes.

When it finishes, open your domain with /ghost added to the address and create the owner account.

If the install fails

If an install goes wrong, remove it with the uninstall command and start again, rather than deleting the folder by hand. That way nothing is left behind. If the install was interrupted, for example by a dropped connection, the setup command restarts the configuration. The doctor command checks the server for known problems.

Terminal window
ghost uninstall # remove a failed install, then run ghost install again
ghost setup # restart the configuration after an interruption
ghost doctor # check the server for known problems

On your own computer, for theme work

A local install is a private copy of Ghost on your own Mac, Windows or Linux computer. It runs in development mode and keeps its database in a single SQLite file, so there is no MySQL to set up. It exists for building and testing themes, and it is not meant to serve a public site.

You need a current Node 22 release, Ghost-CLI and an empty folder. The Node version matters more than the major number suggests. When we tested this in September 2026 on a Mac running Node 22.22.3, Ghost-CLI stopped before downloading anything, with this message.

Ghost v6.65.0 is not compatible with the current Node version. Your node version is 22.22.3, but Ghost v6.65.0 requires ^22.23.1 || ^24.20.0

So check your version first and, if it is not the newest Node 22 release, update it. Then install:

Terminal window
node --version
npm install ghost-cli@latest -g
mkdir ghost-local && cd ghost-local
ghost install local

With Node 22.23.2, the same install took 21 seconds from running the command to a working site. Here is what we found when it finished.

The address. The site is at localhost:2368 and the admin at localhost:2368/ghost. If that port is taken, for example by another copy of Ghost, Ghost-CLI moves to the next free one and prints the address at the end. Ours landed on 2369 for that reason.

The database. It is one SQLite file in the content/data folder. Ours was named ghost-local.db.

Your themes. A theme you are working on goes in the content/themes folder. Ghost reloads when you edit a theme file, but it needs a restart to notice a new file.

Email. No SMTP service is set up, so Ghost falls back to sending mail directly and says so at the end of the install. That is fine locally. A local install does not email staff a sign-in code, so you can log in without working email.

Ghost keeps running in the background until you stop it or restart the computer. These commands work from inside the folder.

Terminal window
ghost stop # stop the site
ghost start # start it again
ghost log # show the logs
ghost ls # list the Ghost sites running on this computer

For the technical reader: since Ghost 6.30, Ghost-CLI installs Ghost’s packages with pnpm rather than npm or yarn, although Ghost’s local install page still mentions those two. If pnpm is missing, Ghost-CLI runs it through corepack. Recent Ghost releases need pnpm 11.10.0 or newer. With an older pnpm installed, Ghost-CLI stops and suggests the update below.

Terminal window
npm install -g pnpm@latest

If you would rather not install Node at all, Docker is the other route. Ghost has said local theme development is coming to its Docker tooling. Until then, the official Ghost image on Docker Hub runs a development copy. This version keeps the content in a named volume, so it survives when the container is removed.

Terminal window
docker run -d --name ghost-local \
-e NODE_ENV=development \
-e url=http://localhost:2368 \
-e database__connection__filename='/var/lib/ghost/content/data/ghost.db' \
-p 2368:2368 \
-v ghost-local-content:/var/lib/ghost/content \
ghost:6-alpine

Install a theme

Every method above ends in the same admin. A theme installs the same way on all of them, as a zip file you upload.

  1. Go to Settings → Site → Theme and click Change theme. You will see Ghost’s official themes on one tab and your installed themes on the other.
  2. Click Upload theme and choose the zip file.
  3. When the upload finishes, click Activate theme in the dialog.

Ghost checks every uploaded theme for compatibility with your version of Ghost. If it finds errors, the button reads Activate with errors instead, and it is worth asking the theme’s author before you activate anyway. On Ghost(Pro), uploading needs the Publisher plan or above.

When a new version of the theme arrives, our guide to updating a Ghost theme covers installing it without losing your settings. Our Ghost themes install through this same upload.

The first things to set up

A new Ghost site works straight away, but a few settings are worth visiting in the first hour. This is the order we would take them in.

  1. Email, if you self-host. Sign-ins, staff invitations and password resets all depend on email. Make sure the SMTP details work before you invite anyone or sign in from another device.
  2. Title and basics. Under Settings → General settings, set the title and description, the timezone and the publication language. Staff, meta data and social accounts are in the same group.
  3. Branding. Under Settings → Site → Design & branding, click Customize to open the Brand tab, with the accent color, publication icon, logo, cover image and fonts. The Theme tab next to it holds your theme’s own options.
  4. Newsletters. Newsletter settings are under Settings → Membership → Newsletters; on some sites the section is labelled Email instead. On a self-hosted site without Mailgun configured, a Mailgun card appears there asking for a Mailgun region, domain and private API key. Our guide to Ghost newsletters without Mailgun explains why, and what else works.
  5. The signup window. Settings → Membership → Signup portal → Customize controls what readers see when they subscribe. The Ghost Portal guide covers each option.
  6. Content from elsewhere. If you are moving a publication in, imports live under Settings → Advanced → Import/Export, in the section titled Migration tools. Our guide to migrating from WordPress to Ghost walks through the most common case.

Where this leaves you

You have picked a method, have Ghost running, and know where the first settings live. On Ghost(Pro), the next step is writing, plus a custom domain when you are ready. On your own server, the next steps are the regular chores: backups, updates and newsletter sending, which our guide to self-hosting Ghost covers one by one.

Frequently Asked Questions

What is the easiest way to install Ghost?
Ghost(Pro), because there is nothing to install. You sign up on ghost.org, name your publication, and Ghost creates the site on a free ghost.io address in about a minute. New accounts start on a 14-day free trial, and to keep the site afterwards you pick a plan under Ghost(Pro), then Billing.
What do I need to self-host Ghost?
A Linux server, a domain whose A record points at it, and an SMTP service for sign-in emails, staff invitations and password resets. Ghost's Docker Compose setup also needs Docker 20.10.13 or later. A Ghost-CLI install needs Ubuntu 22.04, 24.04 or 26.04, MySQL 8, NGINX, a current Node 22 release and at least 1 GB of memory.
Should I install Ghost with Docker or Ghost-CLI?
Docker, for a new site. Ghost's own Docker Compose setup is still labelled a preview, but Ghost has announced that it becomes the official method with Ghost 7, when Ghost-CLI moves to security fixes only. A site that already runs on Ghost-CLI can stay there for now.
Can I install Ghost on my own computer?
Yes. With a current Node 22 release and Ghost-CLI installed, the command ghost install local sets up a private copy at localhost:2368 that keeps its database in a single SQLite file. It suits building or testing a theme. It is not meant for a public site.
Can I use MariaDB instead of MySQL?
Not for a public site. Ghost supports only MySQL 8 in production, and it strongly recommends that sites still on MariaDB move off it. The SQLite file a local install uses is for development only.
Can I switch install methods later?
Yes. A publication can move between Ghost(Pro) and a server of your own, or between self-hosted setups, by moving its content, members and theme. Our self-hosting guide covers moving to a new server, and moving from Ghost(Pro) to your own. For one common switch, from Ghost-CLI to Docker, Ghost's Docker setup includes a migration assistant. It moves the site onto Docker on the same server, and it can roll back if something goes wrong.

Keep reading