Demo of running nextcloud with rootless podman by using these containers
image |
---|
docker.io/library/mariadb:latest |
docker.io/library/redis:latest |
docker.io/library/nginx:alpine |
docker.io/library/nextcloud:fpm |
Data is stored in bind mounted volumes under the directory ~/nextcloud-data. All files and directories have the ownership of the regular user on the host. No pods are used. All containers are running in a custom network. Nginx is configured to use socket activation.
status: experimental
Warning
This guide configures nginx to use HTTP. HTTP requests and responses are sent in plaintext to the web browser. This is insecure. For real production use cases, you need to configure nginx to use HTTPS.
Tested with podman 5.3.0-RC1
A minimal test to see that it's possible to log in worked:
sudo useradd test
sudo machinectl shell --uid=test
git clone https://github.com/eriksjolund/nextcloud-podman.git
cd nextcloud-podman
- Run command
The number chosen specifies the port. The command might take a few minutes before it returns because pulling docker.io/library/nextcloud:fpm can take a while.
bash install.sh 8080
- In a web browser go to http://localhost:8080
- Wait until the nextcloud web interface is shown. (Possibly reloading the webpage is required?). This step might take about 5 minutes.
- Fill in a username and a password in the create admin account web form.
- Log in with the username and password.
- Check disk consumption in the bind-mounted directories ~/nextcloud-data
$ podman unshare du -sh ~/nextcloud-data/ 883M /var/home/test/nextcloud-data/ $
- Verify that all files and directories under ~/nextcloud-data are owned by the regular user on the host
result: yes, all files and directories under ~/nextcloud-data are owned by the regular user on the host
$ podman unshare find ~/nextcloud-data -not -user 0 $ podman unshare find ~/nextcloud-data -not -group 0 $
https://github.com/eriksjolund/podman-nginx-socket-activation about: nginx, podman, socket activation
https://github.com/eriksjolund/podman-detect-option
about: --userns keep-id:uid=$uid,gid=$gid
containers/podman#20519 This project was created to see if it is possible to run nextcloud in multiple containers (nextcloud, mariadb, redis, nginx) with rootless podman and at the same time only create files and directories that are owned by the regular user on the host. See the discussion for the starting point of the idea.