October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
VGSources
Blog

How to Run Ghost With Docker Compose on a VPS

A practical, current guide to deploying Ghost with the official ghost-docker Compose stack on a VPS, including prerequisites, DNS, secrets, Caddy TLS, MySQL, SMTP, verification and recovery steps.
Length10 min Posted Quest giverVGSources Team
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The most maintainable starting point is Ghost’s official ghost-docker stack. It runs Ghost, Caddy for the web server and TLS, and MySQL as Docker Compose services. You provide a Linux VPS, a domain whose A record points to that server, Docker 20.10.13 or newer, and an SMTP service, then finish Ghost’s setup at /ghost.

The official Docker instructions are marked preview, so check the repository’s current files while you deploy. The commands below use the modern Compose plugin command, docker compose, rather than the older hyphenated docker-compose.

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What this deployment actually installs

The official tooling is a small Compose project rather than a single Ghost container. Its intended components are:

  • Ghost: the publishing application and admin interface.
  • Caddy: the reverse proxy and TLS front end.
  • MySQL: the database service used by Ghost.

The Ghost Foundation repository is github.com/TryGhost/ghost-docker. Its top-level project includes Caddy and MySQL initialization directories. The repository uses a standard upstream MySQL image; do not assume a custom database image or a particular Ghost image tag without checking the Compose file you cloned.

#1 Best Overall
Sale
Gaoye Blue Light Blocking Glasses
  • BLUE LIGHT BLOCKING GLASSES: Our blue light glasses for women boast UV400 protection, blocking harmful blue rays from computer screens. With these bluelight glasses women, you can enjoy gaming, reading, or watching TV with no worries of eye strain.
  • EYE RELIEF: Our blue light glasses are engineered to reduce blurry vision or strain caused by prolonged screen time. These womens blue light glasses aid in better sleep by preventing blue light from disrupting your natural sleep cycle, helping you fall asleep faster and enjoy a more restful night's sleep, making them the perfect christmas present.
  • COMFORTABLE: Crafted from durable material, our trendy blue light glasses for woman or blue light glasses men ensure long-lasting comfort. The high-transmittance lenses accessories, gamer gifts for men, help keep your eyes relaxed. Perfect stocking stuffers, gifts for gamers men, christmas gifts for men, halloween costumes.
  • LIGHTWEIGHT: These clear blue light glasses feature a lightweight frame, meaning they’ll stay comfy for long-term wear. Perfect as blue blockers glasses for women or mens blue light glasses, these non-prescription fake glasses for men can be worn throughout the day. The blue light blocking glasses women feature polycarbonate HD lenses, which are anti-reflective and restore true color.
  • WORRY-FREE PURCHASE: If you experience any issues, our support team is ready to assist you quickly. These are the perfect costume glasses for cosplay dressing up.

ActivityPub and Analytics services are optional additions in the tooling. Enable them only through the options and environment variables present in the version of the repository you checked out; the exact switches can change because the official page is still a preview.

Requirements before you start

Requirement What to have ready Why it matters
Operating system A Linux VPS; the official install page recommends Ubuntu. The commands and Docker packaging are written for a Linux server.
Docker Docker 20.10.13 or higher. Older engines may not support the behavior expected by the current Compose project.
Compose The Docker Compose plugin, verified with docker compose version. The official steps use the space-separated plugin command.
DNS A domain with an A record pointing to the VPS public IPv4 address. Caddy and Ghost need the hostname to reach this server for the site and certificate.
Email Credentials for an SMTP email service. Ghost needs outbound mail for account workflows and notifications.
Memory At least 1 GB officially; 2 GB is a safer practical baseline. Ghost, MySQL, Caddy and Docker must share the machine’s memory.

The 1 GB figure is the minimum stated in Ghost’s developer documentation. A third-party deployment guide lists 1 vCPU and 2 GB RAM as its documented minimum, and many operators use about 2 GB as a more comfortable baseline. Treat 2 GB as a planning recommendation, not as an official Ghost requirement.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Choose the official stack or a hand-written Compose file

Approach Advantages Risks and trade-offs
Official ghost-docker Ghost-aligned layout; Caddy and MySQL are included; fewer integration decisions. The page is preview documentation, and repository details can change. You must follow the version you actually clone.
Hand-written Compose Freedom to choose a proxy, networks, volumes and service versions. You own TLS, database wiring, upgrades and compatibility. Community examples may lag behind Ghost’s current tooling.

For a new VPS, use the official project unless you already operate a standard infrastructure template. Writing your own file is reasonable when you need an existing proxy or database policy, but it is not a shortcut: every change that the official stack absorbs becomes your maintenance task.

Prepare the VPS and DNS

1. Point the hostname to the server

Create an A record such as blog.example.com pointing to the VPS IPv4 address. Use the exact hostname you intend to enter in Ghost and in the Caddy configuration. Check that the record resolves publicly before starting the proxy. If you also plan to use an IPv6 address, configure an AAAA record only when the VPS is correctly reachable over IPv6; an incorrect AAAA record can make some visitors fail even while IPv4 works.

2. Verify Docker and Compose

On the server, check both versions:

docker version
docker compose version

The Docker engine must be 20.10.13 or newer. If docker compose is unknown, install or enable Docker’s Compose plugin rather than substituting the old docker-compose command in the official procedure. The hyphenated command appears in older community guides and may behave differently.

3. Make sure the web ports are available

Caddy must be able to accept the web traffic for your hostname. Check your VPS firewall and hosting firewall for the HTTP and HTTPS ports Caddy normally uses (TCP 80 and 443). Also check that another web server is not already bound to those ports. If you already run a reverse proxy, decide whether it will hand traffic to this stack or whether the bundled Caddy should be the public front end; do not run two services competing for the same host ports.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Clone Ghost’s Docker project

Place the checkout in /opt/ghost, the location used by the official walkthrough:

Rank #2
Windex Gaming Cleaning Wipes, Pre-Moistened Wipes to Instantly Clean all Gaming Gear and Electronics, Resealable Packaging for a Freshness Lock, 25 count (Pack of 1)
  • WINDEX GAMING WIPES: effortlessly clean all your gaming gear and gaming electronics in one easy step with our new Windex Gaming Wipes
  • AMMONIA FREE: our ammonia-free formula is safe to use on all of your favorite gaming equipment like consoles, headsets, controllers, screens, keyboards, and more
  • PRE-MOISTENED WIPES: each wipe instantly removes dust, dirt, and stubborn smudges and fingerprints leaving a streak-free shine
  • ANTI-STATIC: great for cleaning and wiping down your gaming gear and electronics leaving behind no visible residue
  • COMPACT RESEALABLE PACKAGE: store your pack of Windex Gaming Wipes anywhere in your home for whenever a quick and easy wipedown is needed
sudo mkdir -p /opt/ghost
sudo chown "$USER":"$USER" /opt/ghost
cd /opt
git clone https://github.com/TryGhost/ghost-docker.git ghost
cd /opt/ghost

If your Git installation requires a different transport, clone the repository shown at github.com/TryGhost/ghost-docker into the same directory. Before editing anything, list the files:

ls -la

This matters because the Docker page is preview documentation and filenames can change. You should see the project’s Compose file, an example environment file and a Caddyfile example, along with the caddy and mysql-init directories.

Copy and edit the environment and Caddy files

1. Copy the supplied examples

Copy the repository’s example .env and Caddyfile to the active filenames expected by the Compose project. In the current-style layout these are commonly:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
cp .env.example .env
cp Caddyfile.example Caddyfile

If ls -la shows different example names, use those names instead of forcing the commands above. Do not create an empty file with a guessed name: the Compose file determines which files are loaded.

2. Set the public domain

Open .env and set the site domain to the hostname whose A record points to this VPS. Keep the variable names supplied by the project. Then open the Caddyfile and make sure its site address matches the same hostname. A mismatch commonly produces a site that loads on one name while Ghost generates links or certificates for another.

3. Generate strong database passwords

The official instructions suggest generating passwords with OpenSSL. Generate values rather than reusing an application password:

openssl rand -hex 32
openssl rand -hex 32

Paste the generated values into the database and application secret fields already present in .env. Use the same database credentials wherever the Compose project asks for the matching user, password and database values. Do not rename keys, remove quotes that the example requires, or commit .env to a public repository.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
LISEN Cell Phone Stand Phone Holder for Desk, Office Decor Gadgets for Men
  • Ergonomic & Adjustable Design: Fight "text neck" and improve your posture. Designed for comfort, it offers an adjustable height (7.1in-8.5in) (1.4in adjustable range) and angle (5°-85°) Please note: cell phone stand is only 9 inches tall—the length of a standard pencil
  • Without blocking subtitles Perfect for office desk Tiktok Face Time Zoom video—this is the ultimate kitchen desk essential for phones! Perfect viewing experience while reducing neck back strain, A must-have for gamers streamers desk, and anyone who values both style and support!
  • Sleek & Stable Design fits Otterbox Case: Say goodbye to bent cables, tangles, and tip-overs! LISEN’s stylish adjustable desk phone holder features a built-in charging hole and smart cable management, keeping your phone secure and your workspace clutter-free cool gadgets for men
  • ANTI-SLIP DESIGN free hands: The under 10.00 items easy gadgets back and the bottom of this kitchen essentials for women are fully covered by anti-skid silicone, which LISEN stand up desk decor can provide maximum protection device from any scratches and slides
  • Your Perfect Viewing Companion:If your product arrives damaged or breaks within 365 days, reach out to LISEN for a quick and hassle-free solution. Struggling with assembly, like tightening the screw? We’ve got your back! Your experience matters to us. (Product including: phone Holder stand*1, screw*1, hexagon screwdriver*1, specification*1)

4. Configure SMTP

Enter the SMTP host, port, username, password, encryption mode and sender address required by your mail provider, using the variable names in the supplied example. The sender domain should be one your provider permits. Without working SMTP, the site can still render, but password resets, staff invitations and other Ghost email workflows will fail.

5. Validate the rendered Compose configuration

Before pulling images, ask Compose to parse and render the project:

docker compose config

Fix missing variables, malformed indentation or duplicate keys before continuing. This command does not prove that DNS, SMTP or TLS are correct; it only catches configuration errors that Compose can see locally.

Pull images and start the stack

Run the two commands used by Ghost’s official procedure from /opt/ghost:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. docker compose pull downloads the images referenced by the repository’s current Compose file.
  2. docker compose up -d creates the network, volumes and containers, then starts them in the background.

Immediately inspect the result:

docker compose ps
docker compose logs --tail=100

All required services should reach a running or healthy state. The service names and health checks are defined by the checkout, so use the names printed by docker compose ps rather than assuming a particular container name.

Finish Ghost’s browser setup

Once the containers are running and DNS resolves, open your domain in a browser. Ghost’s initial setup is at:

https://your-domain.example/ghost

Replace the hostname with the domain you configured; do not leave the example text in the URL. Complete the administrator account and site details, then verify that the admin interface loads over HTTPS. If Caddy has not obtained a certificate yet, first confirm that the A record points to this server and that the required web ports are reachable from the internet.

Rank #4
Ledagic IC+RGBW USB Powered Led Light Bar with App & Remote Control, 2 Pack
  • Easy Installation: Our gaming lights have been designed to enhance your entertainment experience. Simply position the led light bar next to your TV or game console to create a game room environment with ease. They come with USB power and a 60 inch cord for direct mounting and mobility
  • Audio Syncing & Extensive Mode: The built-in high-sensitivity music sensor allows you to sync the TV led lights to your favorite music. Lights react and move to the beat of music, film and game audio, creating an incredible immersive sound and light experience – and all without the need for an additional hub. You can choose from 64+ patterns, including strobe, illusion, jump, energy, gradient, running, chasing, fluttering mode etc. Each mode can be applied to different scenes
  • 64+ Chasing IC+RGB & W Effect: The independent control design of IC+RGB and white all-in-one multifunctional rgbw led bar lights monitor backlight allows you to easily switch the led lights for desk between IC+RGB and white to enjoy a variety of lighting effects, you can choose white lighting mode with high brightness for better illumination when working, etc. Choose IC+RGB lighting mode when you need to create an entertaining atmosphere for the light show, 16 million colours of Color changing rgb light bar let you dance to the beat and create a dynamic party atmosphere
  • Dynamic and Dimmable Lights: 1%-full brightness free brightness adjustment gives you the flexibility to adjust dimmable led light bar for room decorations or a variety of occasions
  • USB Powered: USB light bars for room can be powered by powernank, usb charger, TV, Monitor, laptop PC mainframe, making behind TV led lighting bar easy to install in any location.TV led lights are powered by the TV usb interface / PC mainframe, can be turned on/off synchronously with TV / PC

Use the SMTP settings you entered when Ghost asks for email-related configuration or when you test an invitation or password reset. A successful page load does not verify email delivery, so send a test message before inviting other staff.

Enable optional services carefully

The project can include ActivityPub and Analytics services, but they are optional. Start with the smallest stack that meets your needs:

  • Run Ghost, Caddy and MySQL first and establish a working publication.
  • Read the environment example and Compose file for the exact option names in your checkout.
  • Enable one optional service at a time, then run docker compose config and docker compose up -d again.
  • Check docker compose ps and the combined logs after each change.

Do not copy an environment variable from an older article unless it exists in the repository version you cloned. Optional services can add memory use, ports and persistent data that must be included in your backup plan.

Verify the deployment before publishing

  • DNS: The configured hostname resolves to the VPS address from an external network.
  • TLS: The browser shows the expected HTTPS certificate for that hostname.
  • Front end: The home page, an individual post and an image load without mixed-content warnings.
  • Admin: /ghost opens, accepts your administrator login and saves a test setting.
  • Database: Restarting the application container does not remove posts or settings.
  • Email: A test invitation or password-reset message arrives through the configured SMTP service.
  • Persistence: Identify the Docker volumes used for content and MySQL before you rely on the site for real publishing.

Never test persistence by running docker compose down -v on a live installation. The -v option removes named volumes and can destroy the database and uploaded content.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Common failures and their fixes

The domain shows a timeout or the default server

Check the A record first, then confirm that the VPS firewall and hosting firewall allow TCP 80 and 443. Run docker compose ps to see whether Caddy is running. If another web server already owns the ports, stop it or deliberately place it in front of Caddy and configure forwarding; do not start a second public listener blindly.

HTTPS certificate issuance fails

Caddy needs the public hostname to resolve to this machine and to receive the certificate authority’s validation request. Recheck the A record, remove stale records, verify port reachability and inspect the Caddy service logs with docker compose logs caddy if that service name appears in docker compose ps. Certificate issuance can also fail when the Caddyfile hostname does not match the domain in .env.

docker compose is not available

Install Docker’s Compose plugin and verify it with docker compose version. Do not silently change every command to docker-compose; the official procedure is written for the plugin syntax, and older guides may assume a different installation.

Best Value
Sale
HUANUO FlowLift™ Dual Monitor Stand, Fully Adjustable Gaming Monitor Desk Mount for 13–32″ Computer Screens, Full Motion VESA 75x75/100x100 with C-Clamp & Grommet Base, Each Arm Holds 4.4 to 19.8 lbs
  • Compatible with Wide Screens - To ensure compatibility with the dual monitor mount, your each monitor must meet three conditions at the same time: First, computer screens size range: 13 to 32 inches. Second, screen weight range: 4.4 to 19.8 lbs. Third, the back of the monitor screen must have VESA mounting holes with a pitch of 75x75mm or 100x100mm.
  • Regarding the compatibility with desks - Your desk must meet three conditions at the same time: First, desk material: Only wooden desks are recommended, plastic or glass desks cannot be used. Second, desk thickness range: 0.59" - 3.54". Third, the bottom of the desk should not have any cross beams or panels, as this will interfere with installation. We recommend carefully checking that your desk and monitors meets all above conditions before purchasing.
  • Dual C-Clamp Hold - Worried your dual monitors might wobble or slip? Our upgraded base uses a larger platform plus a dual C-clamp structure to lock the dual monitor arm firmly to your desk. Each arm safely keeps your screens steady while you type, click and game—no shaking, no sliding, just a clean and secure setup you can trust every day. It also provides Grommet Mounting installation choice, both options ensure stable and secure fixation for your 0.59" - 3.54" desk.
  • Full-Motion Adjustment For Comfortable View - Pull the screen closer when you’re deep in a spreadsheet, push it back to watch videos, or rotate to portrait for coding — moving everything smoothly with just one hand. The monitor stand offers +85°/-50° tilt, ±90° swivel and 360° rotation. Raise your monitor up to 15.75″ to support a healthy sitting posture. Whether you’re working from home, gaming through the night, or switching between video calls and documents, getting the screens to your natural line of sight helps relieve neck, shoulder and back strain so you can stay focused longer with less fatigue.
  • Keep Your Desk Organized: By lifting both screens off the desktop, this dual monitor stand opens up valuable space for your keyboard, notebook, docking station or a simple, clutter-free work area. Built-in cable management guides wires along the arms, keeping cords out of sight and out of the way. Enjoy a tidy, modern workstation that looks as good as it feels to use.

MySQL repeatedly restarts

Inspect the database logs and compare the database name, user and passwords in .env with the values the Compose file passes to MySQL and Ghost. A password changed after the database volume was initialized does not automatically rewrite the existing database account. Resolve the mismatch before deleting anything; removing the volume can erase the site.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Ghost is killed or the VPS becomes unresponsive

Review memory usage and container logs. Ghost’s official minimum is 1 GB, but a 2 GB VPS gives the application, MySQL, Caddy and the operating system more headroom. If the workload outgrows the machine, increase RAM or move to a larger VPS before experimenting with arbitrary container limits.

Email never arrives

Recheck every SMTP field, including encryption mode, port, username and the permitted sender address. Look for authentication or connection errors in Ghost’s logs and test delivery to more than one mailbox. DNS and HTTPS can be perfect while SMTP remains misconfigured.

You cannot tell which Ghost version will run

Do not infer the image tag from a blog post or from another Compose project. The exact tag was not established for every repository revision; inspect the Compose file in your checkout and record it with your deployment notes. Pinning or changing a tag is an operational decision that should be tested before production use.

Updates, backups and day-to-day operation

Keep the project definition and data separate

The Git checkout contains the service definition; your database and uploaded media live in Docker volumes. Back up both the MySQL data and Ghost content, and store a copy outside the VPS. A backup is useful only if you can restore it, so perform a test restore on a disposable server before the first major upgrade.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use a cautious update sequence

  1. Record the current Git revision, image tags and environment-file backup (without exposing secrets).
  2. Read the current README and inspect changes in the Compose file and Caddy configuration.
  3. Take a verified database and content backup.
  4. Pull the repository changes and run docker compose config.
  5. Pull the new images with docker compose pull, then apply them with docker compose up -d.
  6. Check service health, logs, the public site, /ghost and email delivery.

These are standard Compose operations, not a promise that every Ghost release has the same upgrade procedure. The Docker page is explicitly preview documentation; follow any release-specific migration notes supplied by Ghost before changing production.

Protect the secrets

  • Restrict access to /opt/ghost/.env so ordinary users cannot read database and SMTP credentials.
  • Do not paste the file into issue trackers, chat rooms or public repositories.
  • Use separate credentials for the VPS, database and SMTP service.
  • Keep a record of which backup contains encrypted or unencrypted secrets.

Why the official preview status matters

Ghost’s Docker install page at docs.ghost.org/install/docker is labeled preview. That does not make the stack unusable; it means names, defaults and supported options can change. Before every new installation, compare the repository’s current Compose file, environment example and Caddyfile with the commands in this guide. In particular, verify the Ghost image tag, optional-service switches, volume names and any migration instructions. Those details were not established as fixed values and should never be copied from an outdated tutorial.

Decision checklist

Use the official stack when all of the following are true:

  • You want Ghost, Caddy and MySQL managed together by Compose.
  • You can point a dedicated domain A record at the VPS.
  • You can provide SMTP credentials and at least the documented memory.
  • You are willing to inspect preview documentation and repository changes.

Choose a custom Compose design only when you have a concrete requirement for a different proxy, database arrangement, network layout or organizational standard—and can own the resulting TLS, backup and upgrade work.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More quests from Patch Notes

  1. How to Set Up a RedM (RDR2) Server in 2026: License Key, txAdmin and server.cfg, Step by StepBlog11min
  2. Best RedM (RDR2) Server Hosting in 2026: Comparing Four Hosts on Slots, Memory and PriceBlog10min
  3. How to Host a Mindustry Server in 2026: server-release.jar, Port 6567 and the Commands That MatterBlog7min
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.