From 226f60633b8602f2f3b93bbe1393b9e55ca0d087 Mon Sep 17 00:00:00 2001 From: Aiden Gerbrandt Date: Mon, 9 Nov 2026 20:06:32 -0500 Subject: [PATCH] added quadlets --- README.md | 114 ++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 107 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 76aacfd..69d904b 100644 --- a/README.md +++ b/README.md @@ -2,19 +2,119 @@ `` = the username of the admin user account you created during install. -## Create Container +## Create Containers ``` sudo loginctl enable-linger ``` -Create Folder `/opt/nextcloud` owned by `` +Create Folders: + - `/opt/cloud/nextcloud` + - `/opt/cloud/database` + +`sudo chown -R : /opt/cloud` + +Allow 8080 through the firewall + +### Pod + +| Field | Input | Note | +| ----- | ----- | ----- | +| Name | cloud | | +| Port Mapping | 8080:80 TCP | Format is `host port:container port` | + +### Database container + + Field | Input | Note | +| ----- | ----- | ----- | +| Name | postgresql | | +| Owner | `` | | +| Image | docker.io/library/postgres:18 | | +| Restart Policy | always | Only shows for non-root if linger is enabled +| Volume | /opt/cloud/database -> /var/lib/postgresql | Writable and Private | +| Environment Variables | POSTGRES_USER=nextcloud
POSTGRES_PASSWORD=mysecretpassword
PUID=1000
PGID=1000 | | + +### Nextcloud Container | Field | Input | Note | | ----- | ----- | ----- | | Name | nextcloud | | -| Owner | User | | -| Image | docker.io/library/nextcloud | | -| Restart Policy | always | Only shows for non-root if linger is enabled | -| Port Mapping | 8080:80 TCP | Format is `host port:container port` | -| Volume | /opt/nextcloud -> /var/www/html | Writable and Private | +| Owner | `` | | +| Image | docker.io/library/nextcloud:latest | | +| Restart Policy | always | Only shows for non-root if linger is enabled +| Volume | /opt/cloud/nextcloud -> /var/www/html | Writable and Private | +| Environment Variables | PUID=1000
PGID=1000 | | + +## Migrate Containers to Quadlets + +Stop Containers + +`podman volume create postgresql-data` +`podman volume create nextcloud-data` + +`podman unshare mv /opt/cloud/database/* ~/.local/share/containers/storage/volumes/postgresql-data/_data/` +`podman unshare mv /opt/cloud/nextcloud/ ~/.local/share/containers/storage/volumes/nextcloud-data/_data/` + +`mkdir -p ~/.config/containers/systemd/` + +`nano ~/.config/containers/systemd/cloud.pod` + +```ini +[Unit] +Description=Nextcloud Stack + +[Pod] +PodName=cloud +PublishPort=8080:80 + +[Install] +WantedBy=default.target +``` + +`nano ~/.config/containers/systemd/postgresql.container` + +```ini +[Unit] +Description=Postgres Database for Nextcloud +After=network-online.target + +[Container] +ContainerName=postgresql +Pod=cloud.pod +Image=docker.io/library/postgres:18 +Volume=postgresql-data:/var/lib/postgresql +Environment=POSTGRES_USER=nextcloud +Environment=POSTGRES_PASSWORD=mysecretpassword +Environment=PUID=1000 +Environment=PGID=1000 + +Label=io.containers.autoupdate=registry + +[Service] +Restart=always +``` + +`nano ~/.config/containers/systemd/nextcloud.container` + +```ini +[Unit] +Description=Nextcloud +After=postgresql.service +Requires=postgresql.service + +[Container] +ContainerName=nextcloud +Pod=cloud.pod +Image=docker.io/library/nextcloud:latest +Volume=nextcloud-data:/var/www/html +Environment=PUID=1000 +Environment=PGID=1000 + +Label=io.containers.autoupdate=registry + +[Service] +Restart=always +``` + +`systemctl --user daemon-reload` +`systemctl --user start cloud-pod.service `