# Ghost setup linux-user systemd

**URL:** <https://forum.ghost.org/t/ghost-setup-linux-user-systemd/53569>\
**Category:** Self-hosting\
**Created:** [December 24, 2024, 10:21am UTC](https://forum.ghost.org/t/ghost-setup-linux-user-systemd/53569 "2024-12-24T10:21:54Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![hackermade](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/hackermade/32/33939_2.png) [@hackermade](https://forum.ghost.org/u/hackermade)\
**Post date:** [December 24, 2024, 10:21am UTC](https://forum.ghost.org/t/ghost-setup-linux-user-systemd/53569/1 "2024-12-24T10:21:55Z")

</div>

Hi, I am trying to familiarize myself with the backup and restore process of Ghost. While I successfully back everything up to remote storage, I encounter the following error when attempting to restore:

```auto
A SystemError occurred.

Message: Systemd process manager has not been set up or is corrupted.
Help: Run ghost setup linux-user systemd and try again.

```

I would like to note that I first restored the MySQL database. After that, I copied all the installation files (`content`, `versions`, `current`, `config.production.json`) to `/var/www/demo` with the correct user permissions and folder ownership. Despite this, the error persists. Any idea why this happened?

---

<div class="post-metadata">

**Author:** ![EchonCique](https://avatars.discourse-cdn.com/v4/letter/e/c4cdca/32.png) [@EchonCique](https://forum.ghost.org/u/EchonCique)\
**Post date:** [December 25, 2024, 11:49pm UTC](https://forum.ghost.org/t/ghost-setup-linux-user-systemd/53569/2 "2024-12-25T23:49:44Z")

</div>

I’ll chip in since I replied to your originating post 🙂 .

Did you install Ghost using ghost-cli before you restored the database from the backup?

Here are the official docs that restores the backup generated from “ghost-cli backup” command.

> **[How to reinstall Ghost](https://ghost.org/docs/reinstall/)**
>
> Find out how to get access to new features by reinstalling Ghost so you can update to the latest major version.

---

<div class="post-metadata">

**Author:** ![hackermade](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/hackermade/32/33939_2.png) [@hackermade](https://forum.ghost.org/u/hackermade)\
**Post date:** [December 30, 2024, 8:36pm UTC](https://forum.ghost.org/t/ghost-setup-linux-user-systemd/53569/3 "2024-12-30T20:36:10Z")

</div>

I restored the database by importing the `.sql` file into MySQL. After that, I generated a new Ghost installation using `ghost-cli`. I then removed the `content` directory and `config.production.json` file, replacing them with the backed-up versions. However, I encountered the above error afterward.

---

<div class="post-metadata">

**Author:** ![Cathy\_Sarisky](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/cathy_sarisky/32/25750_2.png) [@Cathy\_Sarisky](https://forum.ghost.org/u/Cathy_Sarisky)\
**Post date:** [December 30, 2024, 9:35pm UTC](https://forum.ghost.org/t/ghost-setup-linux-user-systemd/53569/4 "2024-12-30T21:35:03Z")

</div>

If you haven’t already run the command recommended in the error message, that’s your first step. :)

---

<div class="post-metadata">

**Author:** ![hackermade](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/hackermade/32/33939_2.png) [@hackermade](https://forum.ghost.org/u/hackermade)\
**Post date:** [December 31, 2024, 8:43am UTC](https://forum.ghost.org/t/ghost-setup-linux-user-systemd/53569/5 "2024-12-31T08:43:08Z")

</div>

I have run it more than 10 times and I get the same thing…

 ![Screen Shot 2024-12-31 at 10.42.47](https://us1.discourse-cdn.com/flex015/uploads/ghost2/original/3X/d/6/d63b8000e9982bbb1d74082b4caaf63b0272c11a.png)

---

<div class="post-metadata">

**Author:** ![joe-blocher](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/joe-blocher/32/27872_2.png) [@joe-blocher](https://forum.ghost.org/u/joe-blocher)\
**Post date:** [January 1, 2025, 12:08pm UTC](https://forum.ghost.org/t/ghost-setup-linux-user-systemd/53569/6 "2025-01-01T12:08:24Z")

</div>

> [@hackermade](#):
>
> `Message: Systemd process manager has not been set up or is corrupted.`

Delete the file `ghost_xxx.service` from the `/lib/systemd/system/` directory, so that ghost can rebuild it again.

Run `ls -la /lib/systemd/system/ghost*` to search for the service file.  
Assume `/lib/systemd/system/ghost_localhost.service` is your systemd file.  
Move the file to a backup directory or rename it e.g. `ghost_localhost.service_` or delete it: `sudo rm /lib/systemd/system/ghost_localhost.service`

Then run`sudo systemctl daemon-reload`.

Afterwards the ghost-cli should be able to build the service-file again: `ghost setup linux-user systemd`

The service file looks like:

```auto
[Unit]
Description=Ghost systemd service for blog: localhost
Documentation=https://ghost.org/docs/

[Service]
Type=simple
WorkingDirectory=/var/www/ghost
User=1000
Environment="NODE_ENV=production"
ExecStart=/usr/local/bin/node /usr/local/bin/ghost run
Restart=always

[Install]
WantedBy=multi-user.target

```
