# Automate ghost install

**URL:** <https://forum.ghost.org/t/automate-ghost-install/8255>\
**Category:** Installation\
**Created:** [July 14, 2019, 5:32am UTC](https://forum.ghost.org/t/automate-ghost-install/8255 "2019-07-14T05:32:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ghostjockey](https://avatars.discourse-cdn.com/v4/letter/g/8dc957/32.png) [@ghostjockey](https://forum.ghost.org/u/ghostjockey)\
**Post date:** [July 14, 2019, 5:32am UTC](https://forum.ghost.org/t/automate-ghost-install/8255/1 "2019-07-14T05:32:17Z")

</div>

I am trying to automate both the installation and configuration of ghost on a system I have. I was able to follow [https://www.fastcomet.com/tutorials/ghost/install-ghost-autosetup-script](https://www.fastcomet.com/tutorials/ghost/install-ghost-autosetup-script) for auto install. However I am unable to perform the automation of configuration. Has anybody ever solved this? The configuration asks for hostname, DB credentials and whether to start the systemd service itself. Please share if anybody has done this successfully through a bash script.

---

<div class="post-metadata">

**Author:** ![Hannah](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/hannah/32/22_2.png) [@Hannah](https://forum.ghost.org/u/Hannah)\
**Post date:** [July 16, 2019, 3:18pm UTC](https://forum.ghost.org/t/automate-ghost-install/8255/2 "2019-07-16T15:18:38Z")

</div>

That setup script looks to be quite old, it predates Ghost-CLI and does everything the hard way.

Ghost has it’s own CLI tool for installing Ghost, which is explicitly designed for automation and works seamlessly with bash, or any other automation tool you might want to use like ansible, salt or puppet.

You can read the step by step guide for setting up prerequisites, installing using ghost cli and configuring Ghost here:

> **[How to install & setup Ghost on Ubuntu 16.04, 18.04, 20.04 or 22.04](https://ghost.org/docs/install/ubuntu/)**
>
> A full production install guide for how to install the Ghost professional publishing platform on a production server running Ubuntu 16.04, 18.04, 20.04 or 22.04.

Then, if you want to go to the next level and start automating things the CLI guide will help you understand the CLI tool:

> **[Ghost-CLI - A fully loaded tool for installation and configuration](https://ghost.org/docs/ghost-cli/)**
>
> The best way to install, manage, and update your site locally or when self-hosting Ghost. A full guide for our advanced CLI tool.

Most importantly, pay attention to the `--no-prompt` option, which disables any interactivity. It requires that you pass all flags up front, but using this it is possible to install, setup and configure ghost in either a single command, or 3 separate ones depending on your preference.

---

<div class="post-metadata">

**Author:** ![Hannah](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/hannah/32/22_2.png) [@Hannah](https://forum.ghost.org/u/Hannah)\
**Post date:** [July 16, 2019, 3:19pm UTC](https://forum.ghost.org/t/automate-ghost-install/8255/3 "2019-07-16T15:19:24Z")

</div>

P.S. I’ve moved this out of ideas as it’s already entirely possible & designed for.

---

<div class="post-metadata">

**Author:** ![dsecareanu](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/dsecareanu/32/413_2.png) [@dsecareanu](https://forum.ghost.org/u/dsecareanu)\
**Post date:** [April 27, 2020, 3:49pm UTC](https://forum.ghost.org/t/automate-ghost-install/8255/4 "2020-04-27T15:49:32Z")

</div>

Any hints on how to do ghost update via ansible ad-hoc commands? Also, a ghost update playbook? I’ve searched the web but I can only find ghost install playbooks. Thanks!

PS I can do ghost ls because it’s a global command by using:  
ansible servername -a “ghost ls”

PPS I eventually figured it our through trial and error, though unsure if proper syntax 🙂  
ansible severname -m shell -a “cd /var/www/domain.com/ && ghost update”
