added quadlets
This commit is contained in:
1 file changed
+107
-7
@@ -2,19 +2,119 @@
|
|||||||
|
|
||||||
`<user>` = the username of the admin user account you created during install.
|
`<user>` = the username of the admin user account you created during install.
|
||||||
|
|
||||||
## Create Container
|
## Create Containers
|
||||||
|
|
||||||
```
|
```
|
||||||
sudo loginctl enable-linger <user>
|
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 |
|
| Field | Input | Note |
|
||||||
| ----- | ----- | ----- |
|
| ----- | ----- | ----- |
|
||||||
| Name | nextcloud | |
|
| Name | nextcloud | |
|
||||||
| Owner | User | |
|
| Owner | `<user>` | |
|
||||||
| Image | docker.io/library/nextcloud | |
|
| Image | docker.io/library/nextcloud:latest | |
|
||||||
| Restart Policy | always | Only shows for non-root if linger is enabled |
|
| 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/cloud/nextcloud -> /var/www/html | Writable and Private |
|
||||||
| Volume | /opt/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 `
|
||||||
Reference in new issue
Block a user