Skip to content

Commit

Permalink
Autostart pod on system boot (#1561)
Browse files Browse the repository at this point in the history
* Autostart pod on system boot

* ci: fix pre-commit

---------

Co-authored-by: Revant Nandgaonkar <[email protected]>
  • Loading branch information
elhananjair and revant authored Feb 4, 2025
1 parent 8cf986b commit 56e1da3
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions docs/custom-apps-podman.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,29 @@ Podman (the POD MANager) is a tool for managing containers and images, volumes m
- `bench new-site myerp.net --mariadb-root-password 123456 --admin-password 123123`
- `bench --site myerp.net install-app erpnext`

## Autostart pod

- Systemd is the best option on autostart pods when the system boots. Create a unit file in either `/etc/systemd/system` [for root user] or `~/.config/systemd/user` [for non-root user]

```ruby
[Unit]
Description=Podman system daemon service
After=network-online.target

[Service]
#User=
#Group=
Type=oneshot
ExecStart=podman pod start POD_NAME


[Install]
WantedBy=default.target

```

**Note:** Replace POD_NAME with a created pod name while creating a pod. This is a basic systemd unit file to autostart pod, but multiple options can be used, refer to the man page for [systemd](https://man7.org/linux/man-pages/man1/init.1.html). For better management of containers, [Quadlet](https://docs.podman.io/en/v4.4/markdown/podman-systemd.unit.5.html) is the best option for ease of updating and tracing issues on each container.

## Troubleshoot

- If there is a network issue while building the image, you need to remove caches and restart again
Expand Down

0 comments on commit 56e1da3

Please sign in to comment.