Deploy ghost on a PaaS

Quick tutorial to deploy Ghost.org instance on Clever Cloud:

UPDATE: This article is a little bit old, but some users decided to write a more recent documentation here on how to deploy a Ghost blog on Clever Cloud

ghost logo

1. Retrieve Ghost files

In order to download Ghost files, just visit this page : https://en.ghost.org/download/

Extract the file and put the folder in your favorite place.

2. Open an account on Clever Cloud

Just visit the signup page and follow the steps.

3. Create an application

Add a Node.js application.

More information available in our documentation : http://doc.clever-cloud.com/clever-cloud-overview/add-application/

4. Create a File System Bucket

Let’s store the data!

When you deploy an application, a new instance is created. If you do not persist content files like articles and images, you will lose them between two deployments.

In order to store these files, we have created FS (File System) buckets.

Just add one in the services section.

More information can be found in our documentation : https://doc.clever-cloud.com/databases-and-services/fs-buckets/

You will receive the credentials by email. At the root of the application, create a clevercloud/buckets.json file with the following structure:

[
  {
    "bucket" : "bucketId",
    "folder" : "/content"
  }
]

It tells the application to use the files located in the content directory in the FS Bucket.

With the FTP credentials, upload the files located in your local content folder to the remote FTP folder. At the root of the FTP folder, you should have /data, /images, etc. folders.

5. Ghost Configuration

You have to tell Ghost how you would like to use it by editing the /config.js.

In both development and production sections:

  • change host to 0.0.0.0
  • change port to 8080

6. Deploy the application

Last operation, push the local files to the cloud!

Deploy your application on Clever Cloud is very easy. Just type the following commands:

  • init the git repository : git init
  • create a .gitignore file like this:
node_modules
content
  • add all files: git add .
  • commit: git commit -m firstcommit
  • push to Clever Cloud: git push <ccremoteurl> master

You can then check the logs in the left panel logs section.

Not happy with SQLite? Go MySQL

If you do not want to deal with SQLite storage, you can store your data in MySQL.

To do this, replace the following section:

database: {
  client: 'sqlite3',
  connection: {
    filename: path.join(__dirname, '/content/data/ghost-test.db')
  }
}

with:

database: {
  client: 'mysql',
  connection: {
    host: 'yourhostname',
    user: 'yourusername',
    password: 'yourpassword',
    database: 'yourdbname',
    charset: 'utf8'
  }
}

You can create a MySQL database on Clever Cloud in 5 seconds.

Want to send emails?

Ghost require external mail providers so that you can send emails. Some of them are Mailjet, Mailchimp, Mailgun or Gmail.

The following example allow you to send emails with your Gmail/Google Apps accound from Ghost :

mail: {
  transport: 'SMTP',
  fromaddress: 'myemail@address.com',
  options: {
    auth: {
      user: 'youremail@gmail.com',
      pass: 'yourpassword'
    }
  }
}

Feel free to ask us if you have any questions about this article.

Blog

À lire également

Protect yourself: beware of job scams spoofing Clever Cloud’s brand

At Clever Cloud, we provide reliable, secure cloud hosting services for businesses and developers worldwide. Unfortunately, our reputation is being exploited by malicious actors engaging in fraudulent activities under the guise of our company name. We want to set the record straight and help protect you from falling victim to these scams.
Company

Create your own MCP client/server: as easy as 1-2-3 with Otoroshi

While Otoroshi with LLM already allows you to simplify the management of your various AI providers, access to models and integration with your teams, we have added simplified management of MCP clients and servers.
Company

Clever Cloud obtains HDS (Health Data Hosting) certification

Clever Cloud achieves HDS Certification, enabling it to host health data in France. Clever Cloud, Europe's leading provider of Platform as a Service cloud solutions, today announced that it has been awarded the Hébergeur de Données de Santé (HDS) certification, in its updated version effective May 16, 2024, for all 6 activities in the standard. This certification reinforces Clever Cloud's position as a trusted partner for companies and organizations in the healthcare sector.
Press