Can't start runtipi because of postgres volume permission issues

Hi everyone, I'm trying to install runtipi on my home server, using a fresh install of Fedora 41 but I'm facing a weird permission issue when trying to start the postgres database. I've seen multiple people having this issue online but none of the solutions I've found in those threads helped. Here' s the error I'm facing:
runtipi-db | chown: changing ownership of '/var/lib/postgresql/data': Permission denied
runtipi-db | chmod: changing permissions of '/var/lib/postgresql/data': Permission denied
runtipi-db | find: ‘/var/lib/postgresql/data’: Permission denied
runtipi-db | chown: changing ownership of '/var/lib/postgresql/data': Permission denied
runtipi-db | chown: changing ownership of '/var/lib/postgresql/data': Permission denied
runtipi-db | chmod: changing permissions of '/var/lib/postgresql/data': Permission denied
runtipi-db | find: ‘/var/lib/postgresql/data’: Permission denied
runtipi-db | chown: changing ownership of '/var/lib/postgresql/data': Permission denied
Here's an ls of my folder right after the install:
total 10664
drwxr-xr-x. 1 ketebece ketebece 200 Feb 27 13:32 .
drwx------. 1 ketebece ketebece 350 Feb 27 13:32 ..
drwxr-xr-x. 1 root root 0 Feb 27 13:32 app-data
drwxrwxrwx. 1 root root 0 Feb 27 13:32 apps
drwxr-xr-x. 1 root root 0 Feb 27 13:32 backups
drwxrwxrwx. 1 root root 16 Feb 27 13:32 data
-rw-rw-r--. 1 root root 4054 Feb 27 13:32 docker-compose.yml
-rw-rw-r--. 1 root root 503 Feb 27 13:32 .env
drwxrwxrwx. 1 root root 0 Feb 27 13:32 logs
drwxr-xr-x. 1 root root 0 Feb 27 13:32 media
drwxrwxrwx. 1 root root 0 Feb 27 13:32 repos
-rwxr-xr-x. 1 ketebece ketebece 10904288 Feb 25 15:27 runtipi-cli
drwxrwxrwx. 1 root root 34 Feb 27 13:32 state
drwxrwxrwx. 1 root root 0 Feb 27 13:32 traefik
drwxrwxrwx. 1 root root 0 Feb 27 13:32 user-config
-rw-rw-r--. 1 root root 7 Feb 27 13:32 VERSION
total 10664
drwxr-xr-x. 1 ketebece ketebece 200 Feb 27 13:32 .
drwx------. 1 ketebece ketebece 350 Feb 27 13:32 ..
drwxr-xr-x. 1 root root 0 Feb 27 13:32 app-data
drwxrwxrwx. 1 root root 0 Feb 27 13:32 apps
drwxr-xr-x. 1 root root 0 Feb 27 13:32 backups
drwxrwxrwx. 1 root root 16 Feb 27 13:32 data
-rw-rw-r--. 1 root root 4054 Feb 27 13:32 docker-compose.yml
-rw-rw-r--. 1 root root 503 Feb 27 13:32 .env
drwxrwxrwx. 1 root root 0 Feb 27 13:32 logs
drwxr-xr-x. 1 root root 0 Feb 27 13:32 media
drwxrwxrwx. 1 root root 0 Feb 27 13:32 repos
-rwxr-xr-x. 1 ketebece ketebece 10904288 Feb 25 15:27 runtipi-cli
drwxrwxrwx. 1 root root 34 Feb 27 13:32 state
drwxrwxrwx. 1 root root 0 Feb 27 13:32 traefik
drwxrwxrwx. 1 root root 0 Feb 27 13:32 user-config
-rw-rw-r--. 1 root root 7 Feb 27 13:32 VERSION
I've tried the following: - Installing again from scratch - Changing the ownership of the files to a non root user - Changing the chmod to 777 on everything - Creating a named volume for postgres, that one got me past that error but it created new one and the runtipi-cli will override the compose file on start anyways. Not sure how to reproduce it at this point, it happens all the time, right after a clean install. Happy to provide more details if needed!
26 Replies
Stavros
Stavros5d ago
Hello What os are you running?
Ketebece
KetebeceOP5d ago
Hey, I'm running a fresh install of Fedora 41 Workstation! One additional detail too is that I installed docker and compose using dnf directly: sudo dnf install docker docker-compose
Stavros
Stavros5d ago
Yeah that may be an issue. We recommend using the official install script as it uses the docker repositories ensuring you get the latest version. Package manager versions some times are outdated and have a lot of bugs. Can you please go inside the data directory and show me the output of ls -lah
Ketebece
KetebeceOP5d ago
Sure here you go:
total 0
drwxrwxrwx. 1 root root 16 Feb 27 13:32 .
drwxr-xr-x. 1 ketebece ketebece 200 Feb 27 13:32 ..
drwxr-xr-x. 1 root root 0 Feb 27 13:32 postgres
total 0
drwxrwxrwx. 1 root root 16 Feb 27 13:32 .
drwxr-xr-x. 1 ketebece ketebece 200 Feb 27 13:32 ..
drwxr-xr-x. 1 root root 0 Feb 27 13:32 postgres
If it's of any help I'm running docker 27.3.1 and compose 2.30.3
Stavros
Stavros4d ago
Alright assuming this is a fresh install let's try to do sudo chmod -R 777:777 data (inside the runtipi folder). Do this while all runtipi containers are stopped and try to start again
Ketebece
KetebeceOP4d ago
No dice, here's a log of what I did
Stavros
Stavros4d ago
Something is really messed up with your permissions I suggest deleting the current install
Ketebece
KetebeceOP4d ago
Yeah it's very very strange
Stavros
Stavros4d ago
Running sudo usermod -aG docker yourusername Then logout and log back in And install runtipi without sudo curl -L https://setup.runtipi.io | bash
Ketebece
KetebeceOP4d ago
Okay let me give this a shot
Stavros
Stavros4d ago
This way you add docker permissions to your user without the need to use sudo everytime
Ketebece
KetebeceOP4d ago
Mhhh I don't think it worked, asked me for sudo when running the curl and when I just do a compose it says the engine isn't running
Stavros
Stavros4d ago
After running this you should log out and log back in Else it won't work
Ketebece
KetebeceOP4d ago
Yeah that's what I did
Stavros
Stavros4d ago
What happens if you do docker ps without sudo
Ketebece
KetebeceOP4d ago
ketebece@LAPTOP-23S53C55:~/runtipi$ docker ps
permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.47/containers/json": dial unix /var/run/docker.sock: connect: permission denied
ketebece@LAPTOP-23S53C55:~/runtipi$ docker ps
permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.47/containers/json": dial unix /var/run/docker.sock: connect: permission denied
Stavros
Stavros4d ago
I think that's related to the DNS install, let me look it up
Ketebece
KetebeceOP4d ago
Thanks 🙏
Stavros
Stavros4d ago
Usermod gave you no result right?
Ketebece
KetebeceOP4d ago
Yup Do you think it would be worth uninstalling all of the docker dnf packages and trying again from scratch with the install script?
Stavros
Stavros4d ago
Maybe yeah but usermod is supposed to work with usermod anyway I don't understand why it's failing to give you permissions
Ketebece
KetebeceOP4d ago
Stack Overflow
Permission issue with PostgreSQL in docker container
I'm trying to run a docker image with PostgreSQL that has a volume configured for persisting data. docker-compose.yml version: '3.1' services: db: image: postgres restart: always v...
Ketebece
KetebeceOP4d ago
Okay so some weird things, if I add a :z at the end of the volume name the postgres works but then I have the same problem with the other volumes on the runtipi container... I'll give uninstalling docker a reinstalling with the script tonight, I think there's definitely something weird the volumes permissions Example of another permission error I get when getting past the postgres:
Error: EACCES: permission denied, open '/data/state/settings.json'
runtipi | at async open (node:internal/fs/promises:638:25)
runtipi | at async Object.readFile (node:internal/fs/promises:1242:14)
runtipi | at async generateSystemEnvFile (/app/main.js:428:75869)
runtipi | at async bootstrap (/app/main.js:978:34099) {
runtipi | errno: -13,
runtipi | code: 'EACCES',
runtipi | syscall: 'open',
runtipi | path: '/data/state/settings.json'
runtipi | }
Error: EACCES: permission denied, open '/data/state/settings.json'
runtipi | at async open (node:internal/fs/promises:638:25)
runtipi | at async Object.readFile (node:internal/fs/promises:1242:14)
runtipi | at async generateSystemEnvFile (/app/main.js:428:75869)
runtipi | at async bootstrap (/app/main.js:978:34099) {
runtipi | errno: -13,
runtipi | code: 'EACCES',
runtipi | syscall: 'open',
runtipi | path: '/data/state/settings.json'
runtipi | }
Very odd
Ketebece
KetebeceOP4d ago
Stack Overflow
Permission denied on accessing host directory in Docker
I am trying to mount a host directory in Docker, but then I cannot access it from within the container, even if the access permissions look good. I am doing sudo docker run -i -v /data1/Downloads:/
Ketebece
KetebeceOP4d ago
Okay so running the following command on the runtipi folder seem to have fixed the permission issues with the volumes 🎉
chcon -Rt svirt_sandbox_file_t runtipi
chcon -Rt svirt_sandbox_file_t runtipi
But now I have a new error :despair:
runtipi-reverse-proxy | 2025-02-27T21:19:04Z ERR Provider error, retrying in 3.926110716s error="permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get \"http://%2Fvar%2Frun%2Fdocker.sock/v1.24/version\": dial unix /var/run/docker.sock: connect: permission denied" providerName=docker
runtipi-reverse-proxy | 2025-02-27T21:19:04Z ERR Provider error, retrying in 3.926110716s error="permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get \"http://%2Fvar%2Frun%2Fdocker.sock/v1.24/version\": dial unix /var/run/docker.sock: connect: permission denied" providerName=docker
Happy to report that removing docker dnf packages and reinstalling with the official install script fixed all of my issues! Thank you @Stavros for your help 🙂
Stavros
Stavros4d ago
Cool!

Did you find this page helpful?