Install a production Ghost on local machine?

The local machine install
$ ghost install local
uses SQLite, where as the production version uses MySQL server.

I’d like to install a production version of Ghost on my macOS Big Sur. I would backup the live website and restore it on the local machine.

Purpose: To have a mini-version of the live website on my local machine to experiment and modify without affecting the live website.

Is this possible?

Thank you.

A local version of Ghost should be enough for this, especially if it’s a vanilla install :slight_smile: All a “production” install does is improve reliability and performance

ghost install has several flags for more advanced installations. If you’re looking to create a local ghost install with a MySQL backend, you can run ghost install --db mysql

1 Like

Hi Vikas,

Thank you. Can SQLite import/export a db from/to MySQL using $ mysqldump and $ gunzip ?

Best regards.

It cannot, but it looks like there might be a script to convert a MySQL dump to sqlite:

You can also just run MySQL on your mac :)

1 Like

For local development it might me easier to just do an export via Settings → Labs → Export and then import that to a ghost install local instance running SQLite, that’s generally what I do when working on themes

1 Like

Hi, sorry for replying on old issue.

What should I do if I’m not working on themes but want to test the APIs, such as
https://ghost.org/docs/admin-api/#creating-a-member ?

@John @vikaspotluri123

You can definitely interact with the API on a local install. I do it all the time. :slight_smile:

Things get a little more complicated if you want to hook up to Stripe or test webhooks, but basic API usage works just fine with a local install. :)

1 Like

Thank you for your response!

I have trouble finding related docs or blogs,
so could you kindly suggest me any documentation or blogs about testing API on a local install? Do I have to use tools such as postman?

Isn’t there any problem since production(mysql8) and local(sqlite3) differs?

Nah, database doesn’t matter at all. You’re going to talk to the Ghost API, not the database. :slight_smile:

You /can/ use Postman, but I’ll suggest checking out the Javascript SDK as the easiest way to get started. It handles a bunch of authentication for you.

Also one step up on the ‘breadcrumbs’ for those links is the API documentation. If you get stumped somewhere, feel free to start a new thread, explaining what you’re trying to do and how you’re stuck.

1 Like