added quadlets

This commit is contained in:
Aiden committed 2026-11-09 20:06:32 -05:00
1 parent e9e878a20a
commit 226f60633b
1 file changed
+107 -7
+107 -7
View File
@@ -2,19 +2,119 @@
`<user>` = the username of the admin user account you created during install.
## Create Container
## Create Containers
```
sudo loginctl enable-linger <user>
```
Create Folder `/opt/nextcloud` owned by `<user>`
Create Folders:
- `/opt/cloud/nextcloud`
- `/opt/cloud/database`
`sudo chown -R <user>:<user> /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 | `<user>` | |
| 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 <br> POSTGRES_PASSWORD=mysecretpassword <br>PUID=1000 <br>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 | `<user>` | |
| 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 <br>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 `