# Serverless Ghost

**URL:** <https://forum.ghost.org/t/serverless-ghost/6318>\
**Category:** Ideas\
**Tags:** 🚧-rejected\
**Created:** [March 18, 2019, 2:06pm UTC](https://forum.ghost.org/t/serverless-ghost/6318 "2019-03-18T14:06:07Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nauman\_Mustafa](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/nauman_mustafa/32/2841_2.png) [@Nauman\_Mustafa](https://forum.ghost.org/u/Nauman_Mustafa)\
**Post date:** [March 18, 2019, 2:06pm UTC](https://forum.ghost.org/t/serverless-ghost/6318/1 "2019-03-18T14:06:07Z")

</div>

Hi  
Is it possible to run ghost completely serverless?

- AWS Lambda/Firebase Cloud Functions for compute
- DynamoDB/Firebase DataStore for Database
- S3/Firebase FileStore for file storage

If there are any leads I would love to help out.  
Thanks

---

<div class="post-metadata">

**Author:** ![Kevin](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/kevin/32/32_2.png) [@Kevin](https://forum.ghost.org/u/Kevin)\
**Post date:** [March 18, 2019, 2:12pm UTC](https://forum.ghost.org/t/serverless-ghost/6318/2 "2019-03-18T14:12:33Z")

</div>

> - AWS Lambda/Firebase Cloud Functions for compute

Ghost is in no way architected to work well in that environment, it’s designed to run continuously as a server application.

> - DynamoDB/Firebase DataStore for Database

Database must be MySQL or sqlite, you can configure Ghost to use an external MySQL database hosted by a cloud provider if needed.

> **[Configuration - Adapt your publication to suit your needs](https://ghost.org/docs/config/)**
>
> Find out how to configure your Ghost publication or override Ghost's default behaviour with robust config options, including mail, storage, scheduling and more!

> - S3/Firebase FileStore for file storage

You can use a storage adapter to store files in an external service.

> **[Ghost integrations – official apps, plugins & tools](https://ghost.org/integrations/?tag=storage)**
>
> Ghost plugins, tools & apps to integrate with your Ghost site for automation, analytics, marketing, support and much more! 👉

---

<div class="post-metadata">

**Author:** ![Nauman\_Mustafa](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/nauman_mustafa/32/2841_2.png) [@Nauman\_Mustafa](https://forum.ghost.org/u/Nauman_Mustafa)\
**Post date:** [March 18, 2019, 2:28pm UTC](https://forum.ghost.org/t/serverless-ghost/6318/3 "2019-03-18T14:28:31Z")

</div>

Thanks for the reply, I just want to know what specific component of ghost can’t be ported to 100% serverless protocol.

> [@Kevin](#):
>
> Ghost is in no way architected to work well in that environment, it’s designed to run continuously as a server application.

Even though it is designed for servers, but still it uses REST as its communication protocol, and for its state, it can use database.

> [@Kevin](#):
>
> Database must be MySQL or sqlite, you can configure Ghost to use an external MySQL database hosted by a cloud provider if needed.

Yes, it may be very hard but database calls can be wrapped to use DynamoDB/Firebase DataStore. or provide database adaptor (like storage adaptor) for custom wrapper.

> [@Kevin](#):
>
> Database must be MySQL or sqlite, you can configure Ghost to use an external MySQL database hosted by a cloud provider if needed.

Thanks, I have already tried S3 aws adaptor. And its working

---

<div class="post-metadata">

**Author:** ![GhostDog](https://avatars.discourse-cdn.com/v4/letter/g/85f322/32.png) [@GhostDog](https://forum.ghost.org/u/GhostDog)\
**Post date:** [April 12, 2019, 8:13pm UTC](https://forum.ghost.org/t/serverless-ghost/6318/4 "2019-04-12T20:13:01Z")

</div>

How did the serverless ghost setup go for you? I am considering one…

---

<div class="post-metadata">

**Author:** ![Nauman\_Mustafa](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/nauman_mustafa/32/2841_2.png) [@Nauman\_Mustafa](https://forum.ghost.org/u/Nauman_Mustafa)\
**Post date:** [April 13, 2019, 4:00am UTC](https://forum.ghost.org/t/serverless-ghost/6318/5 "2019-04-13T04:00:21Z")

</div>

So far some progress, I tried using AWS lambda and firebase functions for that did not work at all.  
I have identified a few problems so far.

- ghost has option to implement custom storage adapter, there is a famous s3 adapter I am currently using. This make storage at least serverless.
- next is database. Ghost uses knex library as database adapter which only sports SQL databases. I am currently looking for hooking nosql functionality into knex and change default adapter to either firebase datastore or dynamidb.
- finally there’s cold start problem, even if I am able to run ghost on aws lambda, it will take some time to initialize every time there is a request which is an overhead. I am looking into speed up loading using lazy stuff.

Recently Google announced cloud run which allows us to directly run serverless container. The only thing then missing is database. If I succeed mounting a volume for sqlite storage on cloud run container, it can completely go serverless.

Thanks

---

<div class="post-metadata">

**Author:** ![GhostDog](https://avatars.discourse-cdn.com/v4/letter/g/85f322/32.png) [@GhostDog](https://forum.ghost.org/u/GhostDog)\
**Post date:** [April 14, 2019, 7:04pm UTC](https://forum.ghost.org/t/serverless-ghost/6318/6 "2019-04-14T19:04:15Z")

</div>

Great, thanks a lot for those updates… I think the ghost team should be excited about your research since they’re claiming to “future-proof” it:

> **[Ghost on the JAMstack](https://ghost.org/changelog/jamstack/)**
>
> After some major updates to Ghost's public API and tooling, it's now possible to use Ghost as a completely decoupled headless CMS 👉

---

<div class="post-metadata">

**Author:** ![John\_Goggs](https://avatars.discourse-cdn.com/v4/letter/j/8797f3/32.png) [@John\_Goggs](https://forum.ghost.org/u/John_Goggs)\
**Post date:** [April 22, 2019, 5:14pm UTC](https://forum.ghost.org/t/serverless-ghost/6318/7 "2019-04-22T17:14:29Z")

</div>

I thought I’d contribute towards this.

I’ve spent this past 4-day weekend testing and migrating my Wordpress site over to Ghost. I wanted to run Ghost in App Engine, not a fully hosted VM in EC2 or ComputeEngine. It’s not 100% serverless but it is almost there. After some trial and error, I’ve managed to sort out a production environment and configuration. It’s running in Flex, not standard as you need to be able to write a few files to the system.

In terms of a database, Ghost is SQL only so I decided to use MySQL in CloudSQL. I’ve also used storage adapter for Cloud Storage (GCP) but a [more up to date version](https://github.com/KaySchneider/ghost-google-cloud-storage) as I was having trouble storing my images initially. The GCP storage adapter on the Ghost site is out of date and isn’t working with newer Ghost versions (please update or link two separate versions).

I would like to think you could use Kubernetes or ECS with some modifications to Ghost. I don’t think you could get Ghost to be completely serverless unless you modified the core.

---

<div class="post-metadata">

**Author:** ![hpe](https://avatars.discourse-cdn.com/v4/letter/h/76d3ee/32.png) [@hpe](https://forum.ghost.org/u/hpe)\
**Post date:** [July 4, 2019, 12:36pm UTC](https://forum.ghost.org/t/serverless-ghost/6318/8 "2019-07-04T12:36:19Z")

</div>

If you’re on AWS, Why not use Amazon RDS? It is SQL and compatible with MySQL. Should be easier to get working than porting to a NoSQL solution.

Regards  
Peter

---

<div class="post-metadata">

**Author:** ![Xali\_Sys](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/xali_sys/32/4795_2.png) [@Xali\_Sys](https://forum.ghost.org/u/Xali_Sys)\
**Post date:** [October 21, 2019, 1:41am UTC](https://forum.ghost.org/t/serverless-ghost/6318/9 "2019-10-21T01:41:37Z")

</div>

hpe, here is example for hosting Ghost blog on AWS Lightsail & RDS [https://xalitech.com/setup-ghost-blog-on-aws-lightsail/](https://xalitech.com/setup-ghost-blog-on-aws-lightsail/)

---

<div class="post-metadata">

**Author:** ![CajuCLC](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/cajuclc/32/7393_2.png) [@CajuCLC](https://forum.ghost.org/u/CajuCLC)\
**Post date:** [May 14, 2020, 9:10pm UTC](https://forum.ghost.org/t/serverless-ghost/6318/10 "2020-05-14T21:10:41Z")

</div>

I am running Ghost on my local and then I use httrack to generate the index.html files. Upload to S3 and use CloudFront.

---

<div class="post-metadata">

**Author:** ![John](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/john/32/29288_2.png) [@John](https://forum.ghost.org/u/John)\
**Post date:** [June 10, 2020, 3:35pm UTC](https://forum.ghost.org/t/serverless-ghost/6318/11 "2020-06-10T15:35:16Z")

</div>

Closed on June 10, 2020, 3:35pm UTC


