I assume you're using docker? Paste your compose file here.
I am guessing you haven't set any of your postgres variables prior to running docker compose.
Nextcloud is a suite of client-server software for creating and using file hosting services.
IRC: #nextcloud on libera.chat
Matrix: #nextcloud:matrix.org
Other Nextcloud communities on Lemmy
I assume you're using docker? Paste your compose file here.
I am guessing you haven't set any of your postgres variables prior to running docker compose.
I thought the installation script set the variables?
db:
container_name: db
image: postgres
restart: always
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: NOTMYREALPASS
ports:
- 5432:5432
volumes:
- /opt/postgres/data:/var/lib/postgresql/data
nextcloud:
image: lscr.io/linuxserver/nextcloud:latest
container_name: nextcloud
environment:
- PUID=1000
- PGID=1000
- TZ=Europe/London
volumes:
- /opt/nextcloud/config:/config
- /opt/nextcloud/data:/data
ports:
- 2244:443
- 2245:80
restart: unless-stopped
You need to set POSTGRES_DB
(name it nextcloud_db or something) in both containers env and POSTGRES_HOST
POSTGRES_USER
and POSTGRES_PASSWORD
in the nextcloud env
I would delete your previous containers as well as the config files before you run compose again.
also you didnt declare your variables as strings so they were not being recognized (i assume). I also like to put strings in quotes
also also. you had your postgres envs set with colons instead of =
this compose file should work
services:
db:
container_name: db
image: postgres
restart: always
environment:
- "POSTGRES_USER=postgres"
- "POSTGRES_PASSWORD=NOTMYREALPASS"
- "POSTGRES_DB=nextcloud_db"
ports:
- "5432:5432"
volumes:
- "/opt/postgres/data:/var/lib/postgresql/data"
nextcloud:
image: lscr.io/linuxserver/nextcloud:latest
container_name: nextcloud
environment:
- "PUID=1000"
- "PGID=1000"
- "TZ=Europe/London"
- "POSTGRES_DB=nextcloud_db"
- "POSTGRES_HOST=db"
- "POSTGRES_USER=postgres"
- "POSTGRES_PASSWORD=NOTMYREALPASS"
volumes:
- "/opt/nextcloud/config:/config"
- "/opt/nextcloud/data:/data"
ports:
- "2244:443"
- "2245:80"
restart: unless-stopped
You know you're awesome right?
services:
db:
container_name: db
image: postgres
restart: always
environment:
- "POSTGRES_USER=postgres"
- "POSTGRES_PASSWORD=NOTMYREALPASS"
- "POSTGRES_DB=nextcloud_db"
ports:
- "5432:5432"
volumes:
- "/opt/postgres/data:/var/lib/postgresql/data"
nextcloud:
image: lscr.io/linuxserver/nextcloud:latest
container_name: nextcloud
environment:
- "PUID=1000"
- "PGID=1000"
- "TZ=Europe/London"
- "POSTGRES_DB=nextcloud_db"
- "POSTGRES_HOST=db"
I just copied and pasted, what you wrote, but I'm noticing that in the compose, you're basically making the database NextCloud dedicated, rather than giving it a table. Is that best practice? Sorry if it seems a basic question, I'm still very much in my learning phase.
Yes nextcloud requires the entire database. You could try moving all of your bind mounted dirs to a single dir for the entire compose stack so you dont mix it up with other postgresql containers you may use in the future. So like /opt/nextcloud/db/data:/var/lib/postgresql/data
Personally I like to use volumes for databases.
I really need to thank you. Truly I learned so much from you and I'm extremely grateful. My database works properly now. Thank you!
👍
The docs said to do some shit I didn't understand really. But from what I could gather, essentially open the console and run a command. Problem! Every time I try and open the console for the container, it says it can't read the image details. Okay, let's work around that then.
the problem is you can't really work around a problem you don't understand.
You're right, hence me running into issues. But I figured running the command from my terminal was the same as me running it from Adminer