Introduction
Ghost is a powerful open-source platform designed for professional publishing. Hosting your own instance allows for greater control, customization, and privacy. In this guide, we will walk you through the steps to self-host Ghost on DigitalOcean, a popular VPS provider. We will cover everything from creating your VPS to the installation of Ghost.
Why Choose DigitalOcean for Hosting Ghost?
DigitalOcean is popular among developers for its simplicity, powerful features, and competitive pricing. Below is a pricing comparison with other VPS providers:
| Provider | Monthly Price | Features |
|---|---|---|
| Contabo VPS | 5.99 EUR | 8 GB RAM, 200 GB SSD, unmetered |
| Hetzner Cloud | 4.15 EUR | 16 GB RAM, 400 GB SSD |
| DigitalOcean | 6 USD | 2 GB RAM, 60 GB SSD |
| Vultr | 6 USD | 2 GB RAM, 50 GB SSD |
| Linode (Akamai Cloud) | 5 USD | 2 GB RAM, 50 GB SSD |
DigitalOcean provides a user-friendly control panel, excellent documentation, and a community that supports developers through forums and tutorials.
Step 1: Create a DigitalOcean Account
- Visit DigitalOcean and sign up for an account.
- Complete your account setup by adding payment information.
Step 2: Create a Droplet
- Once logged in, click on โCreateโ in the top right corner and select โDroplets.โ
- Choose an OS - we recommend Ubuntu 22.04 LTS for compatibility with Ghost.
- Select the Droplet plan - the basic 2 GB plan is sufficient for most use cases (6 USD/mo).
- Select your data center region. Choose one nearest to your target audience for better performance.
- Enable additional options as needed, such as backups or monitoring.
- Finally, create your Droplet.
Step 3: Connect to Your Droplet
Once your Droplet is created, you will receive an IP address:
-
Open your terminal or command prompt.
-
Use SSH to connect to your Droplet:
ssh root@your_droplet_ip -
After entering your password, you are now logged into your Droplet.
Step 4: Install Node.js
Ghost requires Node.js to run. Follow these steps to install Node.js and npm:
sudo apt update
sudo apt install curl
curl -sL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt install -y nodejs
To verify the installation, run:
node -v
npm -v
Step 5: Install Ghost CLI
Now install the Ghost CLI, which simplifies the installation and management of Ghost.
sudo npm install -g ghost-cli
Step 6: Set Up Ghost
-
Create a directory for your Ghost installation:
mkdir -p /var/www/ghost cd /var/www/ghost -
Change ownership of the directory:
sudo chown $USER:$USER /var/www/ghost -
(Optional) Use npm to install SQLite or MySQL:
For SQLite:
ghost install sqlite3For MySQL, youโll need to set up a MySQL database and user first.
-
Finally, install Ghost:
ghost installFollow the prompts to set up Ghost. Youโll need to provide your siteโs URL and configure optional settings. The CLI will handle installations for Nginx and SSL.
Step 7: Accessing Ghost Admin Panel
After installation, you can access your Ghost admin panel and set up your blog. Simply navigate to http://your_droplet_ip/ghost in your web browser.
Step 8: Keep Ghost and Your System Updated
To ensure optimal performance and security:
- Update Ghost regularly via the CLI:
ghost update
- Update your system packages:
sudo apt update && sudo apt upgrade -y
FAQs
How much does it cost to self-host Ghost on DigitalOcean?
Hosting Ghost on DigitalOcean starts at 6 USD per month for the basic Droplet plan. This plan is suitable for small to medium-sized sites. Depending on your specific requirements, you might opt for a Droplet with more resources, which will increase your monthly cost. Remember, you can also add additional services such as backups or monitoring that may incur extra charges.
Can I use a custom domain with my Ghost instance?
Yes, you can absolutely use a custom domain with your self-hosted Ghost instance. After your Ghost installation, navigate to your domain registrar and point your domainโs DNS records to your DigitalOcean Dropletโs IP address. Once your domain resolves correctly, you can update the Ghost configuration to recognize the custom domain. Ensure to set up SSL for security using the Ghost CLI.
Is Ghost easy to manage after installation?
Ghost is user-friendly and easy to manage, especially with the Ghost Admin interface. You can handle posts, pages, and design elements without needing deep technical knowledge. The Ghost CLI also streamlines system updates and installations of additional community-supported themes and plugins. For more complex needs and configurations, the documentation and community resources are excellent starting points.
For more detailed comparisons of digital service providers, check out our full VPS comparison. Happy hosting!