App template
Ghost
Ghost 6 for blogs and newsletters, with MySQL and your own SMTP server.
- Memory when idle
- about 400 MiB
- CI measures it once the app is ready and before any traffic. Leave room for more.
- Tested on
- x86 servers
Introduction
Ghost is a publishing platform for blogs and paid newsletters. This template runs Ghost 6 behind your domain, with MySQL on a volume.
Ghost sends sign-in and system email through the SMTP server you entered in the install form.
Values you provide
Owner emailRequired
Email of the site owner, created at deploy time. The password is generated in ghost-secrets/admin-password.
SMTP hostRequired
External SMTP hostname for transactional email.
SMTP portRequired
SMTP TLS port: 465 for implicit TLS or 587 for STARTTLS.
SMTP encryptionOptional
true for implicit TLS on port 465. Leave empty for STARTTLS on port 587.
Default:
falseSender addressRequired
Transactional mail From address.
SMTP credentials secretRequired
Existing namespace Secret containing username and password for your SMTP provider. Create it before deploying.
Made for you
These values are generated at deploy and kept in a Kubernetes Secret, shown as Secret/key.
- ghost-secrets/admin-password
- ghost-secrets/database-password
- ghost-secrets/root-password
Getting started
-
In Zeabur OSS, open the
ghostservice. When Overview shows its replica as ready, the service is up. Its domain is on the Networking tab under Public domains, for exampleblog.example.com. The admin is at/ghoston that domain. -
A setup job creates the site owner from the owner email you entered in the install form, so there is no setup form. Get the owner password. On the
ghostservice, open Variables, clickghost-secretsunder From config files and secrets, and click the eye icon next toadmin-password. Without Zeabur OSS, read Secretghost-secrets, keyadmin-password, with kubectl:kubectl -n <namespace> get secret ghost-secrets -o jsonpath='{.data.admin-password}' | base64 -d -
Open the admin page and sign in with the owner email and that password.
The other keys in ghost-secrets (database-password and root-password) are for MySQL. Ghost does not use root-password.
Configuration
Send newsletters
SMTP only sends system email. To send a post as a newsletter, Ghost needs a bulk email provider, and Mailgun is the only one it supports. In the admin, open the email newsletter settings and enter your Mailgun API keys. See Newsletters and Why do I have to set up Mailgun?.
Back up the data
Ghost keeps posts, members and settings in MySQL, on the volume ghost-mysql-data. Images, themes and other uploads are on the volume ghost-data, mounted at /var/lib/ghost/content. ghost-mysql is a plain MySQL container, not a Zeabur OSS database, so it has no Backups tab. Dump it to a file on your machine with kubectl:
kubectl -n <namespace> exec statefulset/ghost-mysql -- sh -c 'MYSQL_PWD="$MYSQL_PASSWORD" mysqldump --single-transaction --no-tablespaces -h127.0.0.1 -ughost ghost' > ghost.sql
Copy the content folder with the Files tab of the ghost service. For a large folder, use kubectl:
kubectl -n <namespace> cp ghost-0:/var/lib/ghost/content ./ghost-content
The export in the Ghost admin, under Settings > Advanced > Import/Export, gives posts and settings as JSON, but not the images of a self-hosted site. See Exporting content and data in the Ghost docs.
Change the database password
Ghost reads database-password from the Secret, but MySQL sets the password of the ghost user only when its data directory is empty. If you change only the Secret, Ghost cannot connect. Change it in MySQL first. Open Terminal on the ghost-mysql service and run:
mysql --socket=/var/run/mysqld/mysqld.sock -uroot -p"$MYSQL_ROOT_PASSWORD" -e "ALTER USER 'ghost'@'%' IDENTIFIED BY '<new password>'"
Then enter the same value for database-password in ghost-secrets, review and apply, and click Restart on the ghost and ghost-mysql services. See the environment variables in the MySQL image docs.
Troubleshooting
Sign-in or system email fails with a connection timeout
Some hosts block outbound SMTP ports. Use the SMTP port that your provider and your network allow. See Configuration.
The page shows 502 or does not load
Open the ghost service in Zeabur OSS. Check that Overview shows its replica as ready, then read the Logs tab. If the replica is not ready, open Deployments and switch to Events. If Events show OOMKilled, the service ran out of memory. Raise Maximum memory under Settings → Compute. If the service is slow or keeps reconnecting, open the Usage tab. Near memory max means the memory is close to the limit. Raise Maximum memory the same way. If the domain or the certificate stays pending, see Troubleshooting on the domains page.
Without Zeabur OSS, read the logs with kubectl -n <namespace> logs statefulset/ghost and the events with kubectl -n <namespace> get events --sort-by=.lastTimestamp.
See Adjust replicas, resources, and health checks and View logs, events, and usage, and open a terminal in the Zeabur OSS docs.
Resources
Each service is guaranteed the first amount and can use up to the second.
ghost
Ports
2368
CPU
0.1 cores to 2 cores
Memory
256 MiB to 1 GiB
ghost-mysql
Ports
3306
CPU
0.1 cores to 2 cores
Memory
256 MiB to 1 GiB
Technical details
This release
- Version
- 6-alpine
- Licence
- MIT AND GPL-2.0-only
- Homepage
- github.com
- Source file
- templates/ghost/template.yaml @ v0.6.3
Tested in CI
CI installs these exact files on a new cluster, waits until they are ready, then records the idle memory.
| Distribution | Platform | Kubernetes | Passed | Idle memory |
|---|---|---|---|---|
| kind | linux/amd64 | v1.37.0 | 400 MiB |
Security
Ghost's workloads run in their own namespace, pinned by image digest, as non-root with a read-only root filesystem, no API token and extra capabilities dropped. Outbound traffic is not limited.
Known risks
Risk
If Ghost has not been set up yet, the first visitor can create the site owner.
How it is handled
As soon as Ghost answers, the ghost-setup Job creates the owner from ownerEmail and the generated password in ghost-secrets/admin-password. It checks every two seconds, so the window before it runs is short. /ghost and its APIs are open to anyone who can reach the domain, and Ghost has its own sign-in. To limit who can reach /ghost, add an IP limit in the service's network settings.
Risk
MySQL runs as a plain StatefulSet, with no operator to manage it.
How it is handled
Keep one replica. Store both the MySQL backups and the content backups off the node, and protect them. Add a MySQL operator from the catalog before you promise high availability or automatic point-in-time recovery.
Risk
Ghost depends on outside services to send transactional email and newsletters.
How it is handled
Provide an existing SMTP Secret. Set up Mailgun in Ghost for bulk newsletters. Protect the provider credentials in your backups. Self-hosted ActivityPub and Tinybird analytics are not included.
What the cluster needs
Zeabur OSS suggests the components a cluster is missing. Without it, install them first.