<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>ghost Archives | Clever Cloud</title>
	<atom:link href="https://www.clever.cloud/blog/tag/ghost/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.clever.cloud/blog/tag/ghost/</link>
	<description>From Code to Product</description>
	<lastBuildDate>Wed, 13 Dec 2023 17:00:28 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://cdn.clever-cloud.com/uploads/2023/03/cropped-cropped-favicon-32x32.png</url>
	<title>ghost Archives | Clever Cloud</title>
	<link>https://www.clever.cloud/blog/tag/ghost/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Deploy Ghost the Immutable Way on Clever Cloud</title>
		<link>https://www.clever.cloud/blog/features/2019/10/21/ghost-hosting-clever-cloud/</link>
		
		<dc:creator><![CDATA[Laurent Doguin]]></dc:creator>
		<pubDate>Mon, 21 Oct 2019 17:05:00 +0000</pubDate>
				<category><![CDATA[Features]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[ghost]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[Nodejs]]></category>
		<guid isPermaLink="false">https://www2.cleverapps.io/wp/blog/technology/2019/10/21/ghost-hosting-clever-cloud/</guid>

					<description><![CDATA[<p><img width="1400" height="540" src="https://cdn.clever-cloud.com/uploads/2021/08/deploy-ghost-1.png" class="attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="deploy ghost 1" decoding="async" fetchpriority="high" srcset="https://cdn.clever-cloud.com/uploads/2021/08/deploy-ghost-1.png 1400w, https://cdn.clever-cloud.com/uploads/2021/08/deploy-ghost-1-300x116.png 300w, https://cdn.clever-cloud.com/uploads/2021/08/deploy-ghost-1-1024x395.png 1024w, https://cdn.clever-cloud.com/uploads/2021/08/deploy-ghost-1-768x296.png 768w, https://cdn.clever-cloud.com/uploads/2021/08/deploy-ghost-1-1368x528.png 1368w" sizes="(max-width: 1400px) 100vw, 1400px" /></p>I am currently on a personal quest for a self hosted blog platform that <em>just work</em>. So might you see more posts about blog platform. And the first candidate I wanted to try is Ghost, since it's advertised as the natural successor to Wordpress(Because yes I don't want Wordpress, It's too old and I am in tech so I just can't).

<span id="more-2966"></span>

Ghost is in their own words:
<blockquote>A fully open source, adaptable platform for building and running a modern online publication. We power blogs, magazines and journalists from Zappos to Sky News.</blockquote>
Sounds promising, let's dig in. It's written in NodeJS, and it requires MySQL. Should work right off the bat on Clever Cloud. That is if they follow an immutable approach to production deployment. And as it turns out, they don't really do that. It's even harder if you try to stick to recommended production tools and methods. So it <em>might</em> be a little more complicated than I thought at the begining. But it ended up working fine. Here's how.
<h2 id="your-local-blog-installation">Your local blog installation</h2>
The first thing to do is create your blog locally. Ghost comes with a CLI tool you can install with npm or yarn. I am using npm so <code>npm install -g ghost-cli</code>. Then simply create a folder, change directory and install a Ghost blog:
<pre><code class="language-bash">mkdir myblog
cd myblog
ghost install local
</code></pre>
You should see some logs and right at the end an invitation to go to <code>http://localhost:2368/ghost/</code>. This is your new blog. You should go through a configuration wizard to setup everything. It's using the development configuration right now, with a local SQL lite database and logs written to disk. Now you can stop the local blog by running <code>ghost stop</code>.

If you list the content of your directory you should see the following:
<pre><code class="language-bash">[ldoguin@caolila:~/myblog]$ ls
content/  current@  versions/  config.development.json
</code></pre>
All the specifics of your blog are stored in <code>content</code>. <code>current</code> is a symbolic link to the latest Ghost release downloaded in the <code>versions</code> folder. There is another symbolic link in <code>content/themes/casper</code> that points to the latest capser theme built in Ghost. This link will likely be broken once the blog is pushed to Clever Cloud because of the way we will install Ghost on it. So what you can do right now is replace that link with the actual content of the theme, and add a couple of other themes for good measure. It's also the time to create our git repository. Because the new themes are going to be <a href="https://git-scm.com/book/en/v2/Git-Tools-Submodules">git submodules</a>. This way it can easily be updated, while controlling the version.
<pre><code class="language-bash">rm content/themes/casper/
cp -r current/content/themes/casper/ content/themes/
git init
cd content/themes/
git submodule add https://github.com/curiositry/mnml-ghost-theme
git submodule add https://github.com/zutrinken/attila/
</code></pre>
To test the new theme let's start Ghost in debug mode: <code>ghost run -D</code>. If you go back to the admin page under <code>http://localhost:2368/ghost/</code>, click on the Design tab and you will see your new installed themes at the end of the page. Once you are done you can stop the server by simply hitting <em>Ctrl-c</em>.

Now you have a running installation locally, let's see how to move it to the Cloud.
<h2 id="your-blog-on-clever-cloud">Your blog on Clever Cloud</h2>
To interact with Clever Cloud I recomment using our wonderful CLI clever-tools available easily on most distributions as you can see in our <a href="https://github.com/CleverCloud/clever-tools#installation">documentation</a>. This is the tool I will use in the example. You can of course do the same thing using Clever Cloud's Web Console.

In a terminal, inside your blog folder, run the following command:
<pre><code class="language-bash">clever create --type node myblog # create a node application
clever addon create mysql-addon --plan s_sml myblogsql # create a MySQL database
clever service link-addon myblogsql # Link the database to the application
clever env set NODE_ENV production # setup environment variable for production
clever env set CC_PRE_RUN_HOOK ./clevercloud.sh # run a specific script before the build phase
clever domain add mysuperblog.cleverapps.io # Add a test domain name
</code></pre>
Now there is an existing application and a database on Clever Cloud, configured to run Ghost. But then we still need to create a bunch of files.
<h3 id="installing-ghost-for-your-clever-cloud-application">Installing Ghost for your Clever Cloud Application</h3>
You have seen in the previous step an envionment variable pointing to a <a href="https://www.clever.cloud/developers/clever-cloud-overview/hooks/">pre run hook</a>. It allows us run arbitrary code before the build phase. So let's create that executable file with <code>touch clevercloud.sh</code> and <code>chmod +x clevercloud.sh</code> at the root of our repository. And as for the content here it is:
<pre><code class="language-bash">#!/bin/sh
npm install -g ghost-cli # install ghost-cli on Clever Cloud
mkdir ghost # create a folder for a new local instance of Ghost
cd ghost
ghost install local
ghost stop
cp ../config.production.json . # copy the production configuration
</code></pre>
After that script we will have installed <em>ghost-cli</em> and the latest version of Ghost available. This script can be modified to have a specific version installed if you wanted to. But the thing is I like using upstream code: fail eary, fail often. Now on to the actual configuration.
<h3 id="configure-ghost-for-production">Configure Ghost for Production</h3>
To configure Ghost you have two options. You can use a json file or environment variable. Here I am using a mix of two. Things that won't change when deploying on Clever Cloud are going in the file. Things that may change, like the database used or the url, will be configured as environment variables.

Let's start with the configuration file. You can copy the existing development file or create a brand new one with <code>touch config.production.json</code>. And here's the content:
<pre><code class="language-json">{
  "server": {
    "port": 8080,
    "host": "0.0.0.0"
  },
  "database": {
    "client": "mysql"
  },
  "mail": {
    "transport": "Direct"
  },
  "process": "local",
  "logging": {
    "level": "debug",
    "transports": [
      "stdout"
    ]
  },
  "paths": {
    "contentPath": "../../../content/"
  }
}
</code></pre>
In this file you can see that the only logging transport used is <em>stdout</em>. As Clever Cloud uses Immutable infrastructure and might restart your application when needed, writing logs on file is pointless as they may be lost. Writing them in the standard output is what we advize and you can always configure <a href="https://www.clever.cloud/developers/clever-cloud-apis/add-ons-log-collector/">log drains</a> if you want to use a third party log management tool. Database client is rightly set to <em>mysql</em>. Something else that is changing from the developer configuration is the <em>contentPath</em>. It's the path to your specific Ghost data, themes, assts, etc.. This is the folder where the themes are installed for instance. You can give an absolute or relative path. I'am using the relative path. And it starts in the running Ghost instance. In our case the Ghost version is installed by <code>/clevercloud.sh</code> in <code>/ghost/versions/versionUsed/</code> and our content is available in <code>/content/</code>. So we need to go up three directories to make sure it founds our <code>content</code> folder.

And here is the list of environment variables. I have copy pasted the database values from the result of the <code>clever env</code> command.
<pre><code class="language-bash">clever env set database__connection__host btxgsb7xrhkuydlmb3zr-mysql.services.clever-cloud.com
clever env set database__connection__user ukf6bzfjgd2eg0iw
clever env set database__connection__password 87xRmGJljF3aSgGullm
clever env set database__connection__database btxgsb7xrhkuydlmb3zr
clever env set database__connection__port 20222
clever env set url https://mysuperblog.cleverapps.io/
</code></pre>
At this point we have a properly configured Ghost instance using our own set of files. Now the question is how do you run it ?
<h3 id="run-ghost">Run Ghost</h3>
With node-js applications deployed on Clever Cloud we usually run the <em>main</em> or <em>start</em> field available in package.json. So what we can do is create it with <code>touch package.json</code> and add a start field that will run the blog with ghost-cli:
<pre><code class="language-json">{
    "name": "ghost",
    "version": "0.1.0",
    "description": "",
    "scripts": {
        "start": "ghost run --dir ghost"
    },
    "devDependencies": {
    },
    "dependencies": {
    }
}
</code></pre>
Here we have a configured, ready to run Ghost instance. To deploy on Clever Cloud we push code to a remote git branch. We need to do our first commit but first a bit of cleanup.
<h3 id="ignoring-local-development-files">Ignoring local development files</h3>
There are a bunch of files we should not add to our git repository. Basically all the files related to our local deployment. So I added them to a <code>.gitignore</code> file and invite you to do the same.
<pre><code class="language-gitignore">.ghost-cli
config.development.json
current
versions
</code></pre>
<h3 id="git-push-to-production">Git push to Production</h3>
Now you should have a fairly simple git add to do:
<pre><code class="language-bash">git add clevercloud.sh package.json config.production.json content
git commit -m "Initial commit"
clever deploy
</code></pre>
If you go to <a href="https://mysuperblog.cleverapps.io/ghost/">https://mysuperblog.cleverapps.io/ghost/</a> you will run through the setup again, but this time storing things in the MySQL database. Take a look at the <a href="https://ghost.org/docs/concepts/config/">configuration options</a> for Ghost, there are still a bunch of things you can do like setting up a proper email SMTP server.

And what about the traditional Production configuration from Ghost's documentaiton like SSL Configuration, reverse proxy and such? Well the beauty of using Clever Cloud is that everything is taken care of for you. Nothing else to do.

And there you have it, your new blog is online. Deployed the immutable way.]]></description>
										<content:encoded><![CDATA[<p><img width="1400" height="540" src="https://cdn.clever-cloud.com/uploads/2021/08/deploy-ghost-1.png" class="attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="deploy ghost 1" decoding="async" srcset="https://cdn.clever-cloud.com/uploads/2021/08/deploy-ghost-1.png 1400w, https://cdn.clever-cloud.com/uploads/2021/08/deploy-ghost-1-300x116.png 300w, https://cdn.clever-cloud.com/uploads/2021/08/deploy-ghost-1-1024x395.png 1024w, https://cdn.clever-cloud.com/uploads/2021/08/deploy-ghost-1-768x296.png 768w, https://cdn.clever-cloud.com/uploads/2021/08/deploy-ghost-1-1368x528.png 1368w" sizes="(max-width: 1400px) 100vw, 1400px" /></p>I am currently on a personal quest for a self hosted blog platform that <em>just work</em>. So might you see more posts about blog platform. And the first candidate I wanted to try is Ghost, since it's advertised as the natural successor to Wordpress(Because yes I don't want Wordpress, It's too old and I am in tech so I just can't).

<span id="more-2966"></span>

Ghost is in their own words:
<blockquote>A fully open source, adaptable platform for building and running a modern online publication. We power blogs, magazines and journalists from Zappos to Sky News.</blockquote>
Sounds promising, let's dig in. It's written in NodeJS, and it requires MySQL. Should work right off the bat on Clever Cloud. That is if they follow an immutable approach to production deployment. And as it turns out, they don't really do that. It's even harder if you try to stick to recommended production tools and methods. So it <em>might</em> be a little more complicated than I thought at the begining. But it ended up working fine. Here's how.
<h2 id="your-local-blog-installation">Your local blog installation</h2>
The first thing to do is create your blog locally. Ghost comes with a CLI tool you can install with npm or yarn. I am using npm so <code>npm install -g ghost-cli</code>. Then simply create a folder, change directory and install a Ghost blog:
<pre><code class="language-bash">mkdir myblog
cd myblog
ghost install local
</code></pre>
You should see some logs and right at the end an invitation to go to <code>http://localhost:2368/ghost/</code>. This is your new blog. You should go through a configuration wizard to setup everything. It's using the development configuration right now, with a local SQL lite database and logs written to disk. Now you can stop the local blog by running <code>ghost stop</code>.

If you list the content of your directory you should see the following:
<pre><code class="language-bash">[ldoguin@caolila:~/myblog]$ ls
content/  current@  versions/  config.development.json
</code></pre>
All the specifics of your blog are stored in <code>content</code>. <code>current</code> is a symbolic link to the latest Ghost release downloaded in the <code>versions</code> folder. There is another symbolic link in <code>content/themes/casper</code> that points to the latest capser theme built in Ghost. This link will likely be broken once the blog is pushed to Clever Cloud because of the way we will install Ghost on it. So what you can do right now is replace that link with the actual content of the theme, and add a couple of other themes for good measure. It's also the time to create our git repository. Because the new themes are going to be <a href="https://git-scm.com/book/en/v2/Git-Tools-Submodules">git submodules</a>. This way it can easily be updated, while controlling the version.
<pre><code class="language-bash">rm content/themes/casper/
cp -r current/content/themes/casper/ content/themes/
git init
cd content/themes/
git submodule add https://github.com/curiositry/mnml-ghost-theme
git submodule add https://github.com/zutrinken/attila/
</code></pre>
To test the new theme let's start Ghost in debug mode: <code>ghost run -D</code>. If you go back to the admin page under <code>http://localhost:2368/ghost/</code>, click on the Design tab and you will see your new installed themes at the end of the page. Once you are done you can stop the server by simply hitting <em>Ctrl-c</em>.

Now you have a running installation locally, let's see how to move it to the Cloud.
<h2 id="your-blog-on-clever-cloud">Your blog on Clever Cloud</h2>
To interact with Clever Cloud I recomment using our wonderful CLI clever-tools available easily on most distributions as you can see in our <a href="https://github.com/CleverCloud/clever-tools#installation">documentation</a>. This is the tool I will use in the example. You can of course do the same thing using Clever Cloud's Web Console.

In a terminal, inside your blog folder, run the following command:
<pre><code class="language-bash">clever create --type node myblog # create a node application
clever addon create mysql-addon --plan s_sml myblogsql # create a MySQL database
clever service link-addon myblogsql # Link the database to the application
clever env set NODE_ENV production # setup environment variable for production
clever env set CC_PRE_RUN_HOOK ./clevercloud.sh # run a specific script before the build phase
clever domain add mysuperblog.cleverapps.io # Add a test domain name
</code></pre>
Now there is an existing application and a database on Clever Cloud, configured to run Ghost. But then we still need to create a bunch of files.
<h3 id="installing-ghost-for-your-clever-cloud-application">Installing Ghost for your Clever Cloud Application</h3>
You have seen in the previous step an envionment variable pointing to a <a href="https://www.clever.cloud/developers/clever-cloud-overview/hooks/">pre run hook</a>. It allows us run arbitrary code before the build phase. So let's create that executable file with <code>touch clevercloud.sh</code> and <code>chmod +x clevercloud.sh</code> at the root of our repository. And as for the content here it is:
<pre><code class="language-bash">#!/bin/sh
npm install -g ghost-cli # install ghost-cli on Clever Cloud
mkdir ghost # create a folder for a new local instance of Ghost
cd ghost
ghost install local
ghost stop
cp ../config.production.json . # copy the production configuration
</code></pre>
After that script we will have installed <em>ghost-cli</em> and the latest version of Ghost available. This script can be modified to have a specific version installed if you wanted to. But the thing is I like using upstream code: fail eary, fail often. Now on to the actual configuration.
<h3 id="configure-ghost-for-production">Configure Ghost for Production</h3>
To configure Ghost you have two options. You can use a json file or environment variable. Here I am using a mix of two. Things that won't change when deploying on Clever Cloud are going in the file. Things that may change, like the database used or the url, will be configured as environment variables.

Let's start with the configuration file. You can copy the existing development file or create a brand new one with <code>touch config.production.json</code>. And here's the content:
<pre><code class="language-json">{
  "server": {
    "port": 8080,
    "host": "0.0.0.0"
  },
  "database": {
    "client": "mysql"
  },
  "mail": {
    "transport": "Direct"
  },
  "process": "local",
  "logging": {
    "level": "debug",
    "transports": [
      "stdout"
    ]
  },
  "paths": {
    "contentPath": "../../../content/"
  }
}
</code></pre>
In this file you can see that the only logging transport used is <em>stdout</em>. As Clever Cloud uses Immutable infrastructure and might restart your application when needed, writing logs on file is pointless as they may be lost. Writing them in the standard output is what we advize and you can always configure <a href="https://www.clever.cloud/developers/clever-cloud-apis/add-ons-log-collector/">log drains</a> if you want to use a third party log management tool. Database client is rightly set to <em>mysql</em>. Something else that is changing from the developer configuration is the <em>contentPath</em>. It's the path to your specific Ghost data, themes, assts, etc.. This is the folder where the themes are installed for instance. You can give an absolute or relative path. I'am using the relative path. And it starts in the running Ghost instance. In our case the Ghost version is installed by <code>/clevercloud.sh</code> in <code>/ghost/versions/versionUsed/</code> and our content is available in <code>/content/</code>. So we need to go up three directories to make sure it founds our <code>content</code> folder.

And here is the list of environment variables. I have copy pasted the database values from the result of the <code>clever env</code> command.
<pre><code class="language-bash">clever env set database__connection__host btxgsb7xrhkuydlmb3zr-mysql.services.clever-cloud.com
clever env set database__connection__user ukf6bzfjgd2eg0iw
clever env set database__connection__password 87xRmGJljF3aSgGullm
clever env set database__connection__database btxgsb7xrhkuydlmb3zr
clever env set database__connection__port 20222
clever env set url https://mysuperblog.cleverapps.io/
</code></pre>
At this point we have a properly configured Ghost instance using our own set of files. Now the question is how do you run it ?
<h3 id="run-ghost">Run Ghost</h3>
With node-js applications deployed on Clever Cloud we usually run the <em>main</em> or <em>start</em> field available in package.json. So what we can do is create it with <code>touch package.json</code> and add a start field that will run the blog with ghost-cli:
<pre><code class="language-json">{
    "name": "ghost",
    "version": "0.1.0",
    "description": "",
    "scripts": {
        "start": "ghost run --dir ghost"
    },
    "devDependencies": {
    },
    "dependencies": {
    }
}
</code></pre>
Here we have a configured, ready to run Ghost instance. To deploy on Clever Cloud we push code to a remote git branch. We need to do our first commit but first a bit of cleanup.
<h3 id="ignoring-local-development-files">Ignoring local development files</h3>
There are a bunch of files we should not add to our git repository. Basically all the files related to our local deployment. So I added them to a <code>.gitignore</code> file and invite you to do the same.
<pre><code class="language-gitignore">.ghost-cli
config.development.json
current
versions
</code></pre>
<h3 id="git-push-to-production">Git push to Production</h3>
Now you should have a fairly simple git add to do:
<pre><code class="language-bash">git add clevercloud.sh package.json config.production.json content
git commit -m "Initial commit"
clever deploy
</code></pre>
If you go to <a href="https://mysuperblog.cleverapps.io/ghost/">https://mysuperblog.cleverapps.io/ghost/</a> you will run through the setup again, but this time storing things in the MySQL database. Take a look at the <a href="https://ghost.org/docs/concepts/config/">configuration options</a> for Ghost, there are still a bunch of things you can do like setting up a proper email SMTP server.

And what about the traditional Production configuration from Ghost's documentaiton like SSL Configuration, reverse proxy and such? Well the beauty of using Clever Cloud is that everything is taken care of for you. Nothing else to do.

And there you have it, your new blog is online. Deployed the immutable way.]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Deploy ghost on a PaaS</title>
		<link>https://www.clever.cloud/blog/company/2013/10/16/how-to-deploy-ghost-on-clever-cloud/</link>
		
		<dc:creator><![CDATA[Regis Foucault]]></dc:creator>
		<pubDate>Wed, 16 Oct 2013 00:00:00 +0000</pubDate>
				<category><![CDATA[Company]]></category>
		<category><![CDATA[ghost]]></category>
		<category><![CDATA[Nodejs]]></category>
		<guid isPermaLink="false">https://www2.cleverapps.io/wp/blog/technology/2013/10/16/how-to-deploy-ghost-on-clever-cloud/</guid>

					<description><![CDATA[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 1. Retrieve Ghost files In order to download Ghost files, just visit this page : https://en.ghost.org/download/ Extract [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Quick tutorial to deploy <a href="https://ghost.org">Ghost.org</a> instance on Clever Cloud:</p>
<p><strong>UPDATE: This article is a little bit old, but some users decided to write <a href="https://blog.welcomattic.com/blog/2019-04-09-how-to-deploy-ghost-to-clevercloud/">a more recent documentation here on how to deploy a Ghost blog on Clever Cloud</a></strong></p>
<div><img decoding="async" style="max-width: 300px; display: block; margin: 50px auto;" src="https://www2.cleverapps.io/app/uploads/2021/08/ghost-logo.png" alt="ghost logo" /></div>
<p><span id="more-2733"></span></p>
<h3 id="1-retrieve-ghost-files">1. Retrieve Ghost files</h3>
<p>In order to download Ghost files, just visit this page : <a href="https://en.ghost.org/download/">https://en.ghost.org/download/</a></p>
<p>Extract the file and put the folder in your favorite place.</p>
<h3 id="2-open-an-account-on-clever-cloud">2. Open an account on Clever Cloud</h3>
<p>Just visit the <a href="https://api.clever-cloud.com/v2/sessions/login/">signup page</a> and follow the steps.</p>
<h3 id="3-create-an-application">3. Create an application</h3>
<p>Add a Node.js application.</p>
<p>More information available in our documentation : <a href="https://www.clever.cloud/developers/getting-started/quickstart/">http://doc.clever-cloud.com/clever-cloud-overview/add-application/</a></p>
<h3 id="4-create-a-file-system-bucket">4. Create a File System Bucket</h3>
<p>Let&#8217;s store the data!</p>
<p>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.</p>
<p>In order to store these files, we have created FS (File System) buckets.</p>
<p>Just add one in the services section.</p>
<p>More information can be found in our documentation : <a href="https://www.clever.cloud/developers/deploy/addon/fs-bucket/">https://doc.clever-cloud.com/databases-and-services/fs-buckets/</a></p>
<p>You will receive the credentials by email. At the root of the application, create a <code>clevercloud/buckets.json</code> file with the following structure:</p>
<pre><code class="language-json">[
  {
    "bucket" : "bucketId",
    "folder" : "/content"
  }
]
</code></pre>
<p>It tells the application to use the files located in the content directory in the FS Bucket.</p>
<p>With the FTP credentials, upload the files located in your local <code>content</code> folder to the remote FTP folder. At the root of the FTP folder, you should have <code>/data</code>, <code>/images</code>, etc. folders.</p>
<h3 id="5-ghost-configuration">5. Ghost Configuration</h3>
<p>You have to tell Ghost how you would like to use it by editing the <code>/config.js</code>.</p>
<p>In both development and production sections:</p>
<ul>
<li>change host to <code>0.0.0.0</code></li>
<li>change port to <code>8080</code></li>
</ul>
<h3 id="6-deploy-the-application">6. Deploy the application</h3>
<p>Last operation, push the local files to the cloud!</p>
<p>Deploy your application on Clever Cloud is very easy. Just type the following commands:</p>
<ul>
<li>init the git repository : <code>git init</code></li>
<li>create a <code>.gitignore</code> file like this:</li>
</ul>
<pre><code class="language-gitignore">node_modules
content
</code></pre>
<ul>
<li>add all files: <code>git add .</code></li>
<li>commit: <code>git commit -m firstcommit</code></li>
<li>push to Clever Cloud: <code>git push &lt;ccremoteurl&gt; master</code></li>
</ul>
<p>You can then check the logs in the left panel logs section.</p>
<h3 id="not-happy-with-sqlite-go-mysql">Not happy with SQLite? Go MySQL</h3>
<p>If you do not want to deal with SQLite storage, you can store your data in MySQL.</p>
<p>To do this, replace the following section:</p>
<pre><code class="language-javascript">database: {
  client: 'sqlite3',
  connection: {
    filename: path.join(__dirname, '/content/data/ghost-test.db')
  }
}
</code></pre>
<p>with:</p>
<pre><code class="language-javascript">database: {
  client: 'mysql',
  connection: {
    host: 'yourhostname',
    user: 'yourusername',
    password: 'yourpassword',
    database: 'yourdbname',
    charset: 'utf8'
  }
}
</code></pre>
<p>You can create a MySQL database on Clever Cloud in <a href="http://doc.clever-cloud.com/databases-and-services/add-service/">5 seconds</a>.</p>
<h3 id="want-to-send-emails">Want to send emails?</h3>
<p>Ghost require external mail providers so that you can send emails. Some of them are <a href="http://www.mailjet.fr">Mailjet</a>, <a href="http://www.mailchimp.com">Mailchimp</a>, <a href="http://www.mailgun.com">Mailgun</a> or <a href="http://gmail.com">Gmail</a>.</p>
<p>The following example allow you to send emails with your Gmail/Google Apps accound from Ghost :</p>
<pre><code class="language-javascript">mail: {
  transport: 'SMTP',
  fromaddress: 'myemail@address.com',
  options: {
    auth: {
      user: 'youremail@gmail.com',
      pass: 'yourpassword'
    }
  }
}
</code></pre>
<p>Feel free to <a href="mailto:support@clever-cloud.com">ask us</a> if you have any questions about this article.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
