Self-host Nextcloud with Postgres and Redis with Levelrail

Nextcloud file sync, sharing and collaboration on the official image with a bundled Postgres database and a Redis cache for file locking. The admin account is created on first start with the generated password.

  • Authornextcloud
  • LicenceAGPL-3.0-or-later
  • Memory1.5 GiB
  • Services3

How to self-host Nextcloud with Postgres and Redis

  1. Pull the images

    3 images are pulled on your server.

    Show images
    • postgres:17.11-alpine
    • nextcloud:33.0.10-apache
    • redis:7.4.7-alpine
  2. Create the app

    3 services start in a single Compose app, with 3 named volume mounts for your data, on port 80.

  3. Fill in the secrets

    3 secrets are generated and stored encrypted, 7 settings are preset, you do not have to fill in anything.

  4. Open it

    Without a domain the app gets an sslip.io address; add --domain SERVICE=HOST to use your own.

After the first start

  • Sign in as admin with the generated admin password from the app secrets. First start takes a minute while the database is prepared.

Nextcloud with Postgres and Redis requirements

Memory
About 1.5 GiB
Architectures
amd64 unknown, arm64 unknown
Ports
80
Domain
Optional, an sslip.io address is used without one
Settings
none to fill in
License
AGPL-3.0-or-later, network copyleft (agpl) license
  • Listed. It is in the catalog but not verified. Back up the data volume before changing an image tag.

Install Levelrail first

On a server with Levelrail running, run the command above, or open the dashboard: Apps, New app, Browse templates, then Nextcloud with Postgres and Redis. New to Levelrail? Install it on a fresh VPS first.

docker pull ghcr.io/glincker/levelrail:latest

Then levelrail-cli login --device. See Getting started and the Nextcloud with Postgres and Redis docs page.

Deploy Nextcloud with Postgres and Redis your way

Every format below deploys the same pinned images. Pick the one that fits how you work.

Deploy Nextcloud with Postgres and Redis from the CLI

Add --domain SERVICE=HOST to serve a service on your own domain, for example --domain db=app.example.com.

levelrail-cli templates install nextcloud-postgres --name my-nextcloud-postgres

Deploy Nextcloud with Postgres and Redis with the API

Create a token in the dashboard first. Name, env and domains are the request fields.

curl -X POST -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
  https://levelrail.example.com/api/v1/service-templates/nextcloud-postgres/install \
  -d '{
    "name": "my-nextcloud-postgres"
  }'

Nextcloud with Postgres and Redis configuration

Nextcloud with Postgres and Redis services

ServiceImagePortsVolumes
db postgres:17.11-alpine none pgdata -> /var/lib/postgresql/data
nextcloud nextcloud:33.0.10-apache 80 nextcloud_html -> /var/www/html
redis redis:7.4.7-alpine none redis_data -> /data

Nextcloud with Postgres and Redis environment variables

VariableServiceValue
POSTGRES_DB db Preset by the template
POSTGRES_PASSWORD db Generated at deploy
POSTGRES_USER db Preset by the template
NEXTCLOUD_ADMIN_PASSWORD nextcloud Generated at deploy
NEXTCLOUD_ADMIN_USER nextcloud Preset by the template
POSTGRES_DB nextcloud Preset by the template
POSTGRES_HOST nextcloud Preset by the template
POSTGRES_PASSWORD nextcloud Generated at deploy
Show all 10 variables
  • POSTGRES_USERnextcloudPreset by the template
  • REDIS_HOSTnextcloudPreset by the template

Ports and volumes

Ports
80
Volumes
3 named mounts: pgdata -> /var/lib/postgresql/data, nextcloud_html -> /var/www/html, redis_data -> /data

Nextcloud with Postgres and Redis FAQ

How much memory does Nextcloud with Postgres and Redis need?

The catalog lists about 1.5 GiB of memory for Nextcloud with Postgres and Redis across its 3 services.

Does Nextcloud with Postgres and Redis run on arm64?

For Nextcloud with Postgres and Redis, arm64 support is not confirmed; amd64 is unknown.

What licence is Nextcloud with Postgres and Redis under?

Nextcloud with Postgres and Redis is licensed under AGPL-3.0-or-later, which is network copyleft, so source sharing also applies when it is offered as a hosted service.

Does Nextcloud with Postgres and Redis need configuration before it starts?

No. The template fills in its own defaults and generates secrets at deploy time.

Which database does Nextcloud with Postgres and Redis bundle?

The template includes Postgres and Redis, running as its own service.

Which ports does Nextcloud with Postgres and Redis use?

Nextcloud with Postgres and Redis listens on port 80 inside the stack.

Where does Nextcloud with Postgres and Redis keep its data?

In named volumes: pgdata mounted at /var/lib/postgresql/data, nextcloud_html mounted at /var/www/html and redis_data mounted at /data.

Can I deploy Nextcloud with Postgres and Redis on Dokploy or Dokku?

The services and pinned images on this page can be run on any Docker host. The public Dokploy templates list we compared does not have an entry with the same id for Nextcloud with Postgres and Redis, so on Dokploy you would use a Docker Compose application with the file from this page. Dokku deploys container images with its own commands, so the pinned image postgres:17.11-alpine, nextcloud:33.0.10-apache, redis:7.4.7-alpine is what you deploy there.

levelrail-cli templates install nextcloud-postgres --name my-nextcloud-postgres