Install Nextcloud #1

Closed
opened 2025-10-07 22:44:28 +00:00 by juyung · 0 comments
Owner

VPS

Follow Initial Server Setup and Security Essentials for Debian.

DNS

Add DNS records:

kubeload.com A 1.2.3.4
www.kubeload.com A 1.2.3.4
kubeload.com AAAA 2a01:4f8:ffff:ffff::1

Caddy

*.kubeload.com {
  encode zstd gzip

  header {
    Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
    X-Content-Type-Options "nosniff"
    X-Frame-Options "SAMEORIGIN"
    Referrer-Policy "no-referrer"
  }
}

i.kubeload.com {
  reverse_proxy localhost:8080
}

Docker Compose

Get the latest compose.yml from Nextcloud GitHub.

I use Apache to serve PHP for the Nextcloud web server and PostgreSQL for the database.

  • Caddy: reverse proxy
  • Apache: web server
  • PostgreSQL: database

compose.yml:

services:
  # Note: PostgreSQL is an external service. You can find more information about the configuration here:
  # https://hub.docker.com/_/postgres
  db:
    # Note: Check the recommend version here: https://docs.nextcloud.com/server/latest/admin_manual/installation/system_requirements.html#server
    image: postgres:alpine
    restart: always
    volumes:
      - db:/var/lib/postgresql/data:Z
    env_file:
      - db.env

  # Note: Redis is an external service. You can find more information about the configuration here:
  # https://hub.docker.com/_/redis
  redis:
    image: redis:alpine
    restart: always

  app:
    image: nextcloud:apache
    restart: always
    ports:
      - 127.0.0.1:8080:80
    volumes:
      - nextcloud:/var/www/html:z
      # NOTE: The `volumes` config of the `cron` and `app` containers must match
    environment:
      - POSTGRES_HOST=db
      - REDIS_HOST=redis
    env_file:
      - db.env
    depends_on:
      - db
      - redis

  cron:
    image: nextcloud:apache
    restart: always
    volumes:
      - nextcloud:/var/www/html:z
      # NOTE: The `volumes` config of the `cron` and `app` containers must match
    entrypoint: /cron.sh
    depends_on:
      - db
      - redis

volumes:
  db:
  nextcloud:

db.env:

POSTGRES_PASSWORD=insecure-password
POSTGRES_DB=kubeload
POSTGRES_USER=kubeload

Run docker compose up -d

Go to https://i.kubeload.com. Create admin and change POSTGRES_PASSWORD.

### VPS Follow [Initial Server Setup and Security Essentials for Debian](https://blog.juyung.com/posts/en/2024/08/24/). ### DNS Add DNS records: kubeload.com A 1.2.3.4 www.kubeload.com A 1.2.3.4 kubeload.com AAAA 2a01:4f8:ffff:ffff::1 ### Caddy ``` *.kubeload.com { encode zstd gzip header { Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" X-Content-Type-Options "nosniff" X-Frame-Options "SAMEORIGIN" Referrer-Policy "no-referrer" } } i.kubeload.com { reverse_proxy localhost:8080 } ``` ### Docker Compose Get the latest compose.yml from [Nextcloud GitHub](https://github.com/nextcloud/docker/tree/master/.examples/docker-compose/insecure/postgres/apache). I use Apache to serve PHP for the Nextcloud web server and PostgreSQL for the database. - Caddy: reverse proxy - Apache: web server - PostgreSQL: database compose.yml: ``` services: # Note: PostgreSQL is an external service. You can find more information about the configuration here: # https://hub.docker.com/_/postgres db: # Note: Check the recommend version here: https://docs.nextcloud.com/server/latest/admin_manual/installation/system_requirements.html#server image: postgres:alpine restart: always volumes: - db:/var/lib/postgresql/data:Z env_file: - db.env # Note: Redis is an external service. You can find more information about the configuration here: # https://hub.docker.com/_/redis redis: image: redis:alpine restart: always app: image: nextcloud:apache restart: always ports: - 127.0.0.1:8080:80 volumes: - nextcloud:/var/www/html:z # NOTE: The `volumes` config of the `cron` and `app` containers must match environment: - POSTGRES_HOST=db - REDIS_HOST=redis env_file: - db.env depends_on: - db - redis cron: image: nextcloud:apache restart: always volumes: - nextcloud:/var/www/html:z # NOTE: The `volumes` config of the `cron` and `app` containers must match entrypoint: /cron.sh depends_on: - db - redis volumes: db: nextcloud: ``` db.env: ``` POSTGRES_PASSWORD=insecure-password POSTGRES_DB=kubeload POSTGRES_USER=kubeload ``` Run `docker compose up -d` Go to https://i.kubeload.com. Create admin and change POSTGRES_PASSWORD.
juyung added this to the kubeload project 2025-10-07 22:44:28 +00:00
juyung self-assigned this 2025-10-07 22:44:43 +00:00
juyung added the due date 2025-10-06 2025-10-07 22:45:18 +00:00
juyung changed title from Initial setup to Install Nextcloud 2025-10-08 19:28:02 +00:00
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

2025-10-06

Dependencies

No dependencies set.

Reference: juyung/kubeload#1
No description provided.