Deploy Ghost
Ghost is a free and open source publishing platform for building and running modern blogs, magazines, and journals.
This guide shows how to deploy a Ghost instance on Render in just a few minutes. This version uses a SQLite database stored on a Render SSD Disk so your data is saved across deploys and automatically backed up with daily snapshots.
You can also run Ghost with MySQL 5 instead of SQLite using the instructions below. Let’s get started!
Deployment
- Fork render-examples/ghost on GitHub or click ‘Use this template’.
- Create a new Web Service on Render, and give Render permission to access your new repo.
- Make sure the
Environment
is set toDocker
and enter a name for your service. -
Add a Disk under Advanced with the following values:
Name ghost
Mount Path /var/lib/ghost/content
Size 10 GB
Feel free to change this to suit your needs. -
Optional
Using SQLite is sufficient for most Ghost sites. But if your site gets a lot of traffic (more than 100K requests per day), we recommend using MySQL instead of SQLite. Render makes it this equally easy to do.
- Set up a MySQL 5 instance on Render and make a note of the connection details. Make sure to select the
mysql-5
branch when you create your database. - Add the following environment variables under Advanced:
Key Value database__client
mysql
database__connection__host
MySQL hostname (e.g. mysql-xyz0
)database__connection__database
MySQL database name (e.g. mysql
)database__connection__user
MySQL username (e.g. mysql
)database__connection__password
MySQL user password - Set up a MySQL 5 instance on Render and make a note of the connection details. Make sure to select the
That’s it! Save your web service to bring up Ghost. It will take a couple of minutes to start, but future deploys will be much faster.
Your Ghost instance will be available on your .onrender.com
URL as soon as the deploy is live.
You can then configure Ghost by going to https://your-subdomain.onrender.com/ghost
and start creating content for your new site!
Custom Domains for Ghost
Render makes it easy to add a custom domain to your Ghost site, with free and fully managed SSL. Follow the Render custom domains guide to add a domain to your site.
After adding and verifying your domain on Render, make sure to add the following environment variable to your Ghost service on Render. You can do this under the Environment tab.
Key | Value |
---|---|
url | https://www.yourdomain.com |
url
should be set to the primary domain for your site. If your custom domain is set up to redirect www
to the apex domain, set url
to https://yourdomain.com
.
See Running Ghost with config env variables for more information.
Sending Mail from Ghost
You can set up Ghost to send email using an external service like Mailgun which allows up to 10,000 emails per month for free.
See https://ghost.org/docs/concepts/config/#mail for how to get Mailgun credentials for your Ghost domain.
Once you have your credentials, set up the following environment variables under the Environment tab to start sending mail from Ghost.
Key | Value |
---|---|
mail__transport | SMTP |
mail__options__service | Mailgun |
mail__options__auth__user | postmaster@example.mailgun.org |
mail__options__auth__pass | correct horse battery staple |
Render will automatically restart Ghost to apply your new settings.