# Self-hosting Workshop `` = the username of the admin user account you created during install. ## Create Containers ``` sudo loginctl enable-linger ``` Create Folders: - `/opt/cloud/nextcloud` - `/opt/cloud/database` `sudo chown -R : /opt/cloud` Allow 8080 through the firewall ### Pod | Field | Input | Note | | ----- | ----- | ----- | | Name | cloud | | | Owner | `` | | | Port Mapping | 8080:80 TCP | Format is `host port:container port` | ### Database container Field | Input | Note | | ----- | ----- | ----- | | Name | postgresql | | | 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 | | | 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 and Remove Containers ### Create Volumes `podman volume create postgresql-data` `podman volume create nextcloud-data` ### Move data to volumes `podman unshare rsync -a /opt/cloud/database/* ~/.local/share/containers/storage/volumes/postgresql-data/_data/` `podman unshare rsync -a /opt/cloud/nextcloud/* ~/.local/share/containers/storage/volumes/nextcloud-data/_data/` ### Create container configs `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 ``` ### Start containers `systemctl --user daemon-reload` `systemctl --user start cloud-pod.service `