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.
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
| Method | Who it suits | What you need |
|---|---|---|
| Ghost(Pro) | Anyone who wants to publish without running a server | An email address, and possibly a card for the free trial |
| Ghost’s Docker Compose setup | A new self-hosted site | A Linux server with Docker, a domain, an SMTP service for email |
| Ghost-CLI on Ubuntu | A self-hosted site that already uses it | An Ubuntu server and a domain; the steps install the rest |
| Local install | Building or testing a theme | A 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.
- 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.
- Enter your name, your email address and a password of at least 10 characters, then continue.
- Name your publication. The name can be up to 63 characters, without special characters.
- 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.
- 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.
| What | Details |
|---|---|
| A Linux server | Ghost’s own example has 2 GB of memory and one CPU. |
| Docker | Version 20.10.13 or later. Step 1 covers installing it. |
| A domain | With 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 service | For sign-in emails, staff invitations and password resets. |
| A Tinybird account | Optional. 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.
docker --versiondocker compose versionFor 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:
git clone https://github.com/TryGhost/ghost-docker.git /opt/ghost && cd /opt/ghostcp .env.example .envcp caddy/Caddyfile.example caddy/CaddyfileThe 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:
| Setting | What to put there |
|---|---|
DOMAIN | Your site’s domain without https, such as example.com or www.example.com. |
ADMIN_DOMAIN | Optional, 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_PASSWORD | A long random password. |
DATABASE_PASSWORD | A second long random password. |
The lines starting mail__ | Your SMTP service’s host, port, username, password and the “from” address. |
HTTP_PORT, HTTPS_PORT | Leave 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:
openssl rand -hex 32Set 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 domainwww.{$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
docker compose pulldocker compose up -dThe 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.
docker compose logs caddydocker compose logs ghostIf 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.
# after changing a setting in .envdocker compose up -d --force-recreate ghost
# after changing DOMAIN or ADMIN_DOMAINdocker compose up -d --force-recreate ghost caddyNew 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
| What | Details |
|---|---|
| A server | Ubuntu 22.04, 24.04 or 26.04, with at least 1 GB of memory. |
| A domain | With an A record already pointing at the server, so the certificate can be set up during the install. |
| Installed in the steps below | NGINX 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:
ssh root@your_server_ipadduser <user>usermod -aG sudo <user>su - <user>2. Update the server and install NGINX
sudo apt-get updatesudo apt-get upgradesudo apt-get install nginxsudo 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:
sudo apt-get install mysql-serversudo mysqlThen, at the MySQL prompt:
ALTER USER 'root'@'localhost' IDENTIFIED WITH 'caching_sha2_password' BY '<your-new-root-password>';FLUSH PRIVILEGES;exitFor 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:
sudo apt-get updatesudo apt-get install -y ca-certificates curl gnupgsudo mkdir -p /etc/apt/keyringscurl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
NODE_MAJOR=22echo "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 updatesudo apt-get install nodejs -ynode --versionThe 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:
sudo npm install ghost-cli@latest -g
sudo mkdir -p /var/www/sitenamesudo chown <user>:<user> /var/www/sitenamesudo chmod 775 /var/www/sitenamecd /var/www/sitename
ghost installWhat the installer asks
| The installer asks | What to answer |
|---|---|
| Blog URL | The full address with https, such as https://example.com. An IP address causes errors. |
| MySQL hostname | Press Enter to accept localhost, since MySQL is on the same server. |
| MySQL username and password | root, and the password you set in step 3. |
| Ghost database name | Any 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.
ghost uninstall # remove a failed install, then run ghost install againghost setup # restart the configuration after an interruptionghost doctor # check the server for known problemsOn 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.0So check your version first and, if it is not the newest Node 22 release, update it. Then install:
node --versionnpm install ghost-cli@latest -gmkdir ghost-local && cd ghost-localghost install localWith 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.
ghost stop # stop the siteghost start # start it againghost log # show the logsghost ls # list the Ghost sites running on this computerFor 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.
npm install -g pnpm@latestIf 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.
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-alpineInstall 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.
- 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.
- Click Upload theme and choose the zip file.
- 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.
- 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.
- 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.
- 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.
- 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.
- The signup window. Settings → Membership → Signup portal → Customize controls what readers see when they subscribe. The Ghost Portal guide covers each option.
- 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?
What do I need to self-host Ghost?
Should I install Ghost with Docker or Ghost-CLI?
Can I install Ghost on my own computer?
Can I use MariaDB instead of MySQL?
Can I switch install methods later?
Keep reading
Ghost Custom Domain Setup: DNS, SSL and Email
How to point a domain at Ghost(Pro) or a self-hosted site: the DNS records, automatic SSL, the www redirect Ghost does not do for you, and a sending domain.
Ghost Pricing 2026: Every Plan & Hidden Costs
Ghost(Pro) starts at $15/mo, self-hosting from $6/mo. Every plan and feature gate compared, plus the hidden costs, so you pick the right option first.
Ghost Self-Hosting Guide: Server, Install, Upkeep
What self-hosting Ghost involves: the server it needs, Ghost's Docker Compose setup versus Ghost-CLI, email, backups, safe updates and moving to a new server.
Ghost Behind a Reverse Proxy: Loops, Images, Logins
Ghost expects a proxy in front of it. Two settings decide whether it works: the site URL and the forwarded-protocol header. What breaks when either is wrong.
Recommended Themes
Themes with at least one of the features this guide touches: SEO optimization, membership pages and newsletter integration.
Tribune
Strongest hereTribune is the front page of a newspaper. Lead stories beside the day's picture, a Featured list at the edge, then your sections by topic, each in its own layout, under a masthead that folds away as the reader scrolls. Built for newspapers and multi-author magazines that publish several stories a day, and managed entirely from Ghost admin.
Luno
Strongest hereLuno is a blog that works like an app. A menu that stays open in a fixed sidebar, search a keystroke away, a light and dark switch beside your logo, and a homepage that opens with three featured stories as cover cards. Built for travel, lifestyle and product blogs whose readers expect an interface they already know, and managed entirely from Ghost admin.
Comparing options? Browse all premium Ghost themes side by side.
Get every theme in one bundle
The complete Luxe Themes bundle: every theme, one purchase.