Skip to main content
AcademytutorialRun Nextcloud locally with Docker

Run Nextcloud locally with Docker

Five steps, half an hour. After that you have a clean Nextcloud running on your laptop — even if you have never used Docker or a terminal before.

TutorialNextcloudDockerSetupDemoLocal
18 min read

Every other tutorial in this academy needs a working Nextcloud. This is the fastest route: a few commands and you run the official Nextcloud locally on your laptop, identical to production. You do not need to be a programmer — if you can install an app and copy and paste text, you will get through this. After that you install the Conduction apps from the Nextcloud app store, the same path as production.

After this you can move on to Set up a Woo register, Upload files to a Woo publication, or your own experiment.

This is a local development environment. It runs the same software as a real Nextcloud installation and behaves the same way, so everything you learn here applies directly to a production deployment. However, data you store here is not backed up, is not shared with anyone, and can be wiped at any time — for example, running docker compose down -v permanently deletes everything. Use this environment to explore, experiment, and learn. Do not store real, sensitive, or production data here.

No prior experience needed. On a clean laptop, step 0 (installing Docker and learning the terminal) takes about ten minutes. Steps 1 through 5 together take half an hour after that.

If something does not work as expected at any point, the Troubleshooting section at the bottom of this page has solutions for the most common problems.

Step 0: Install Docker and open a terminal

What is Docker?

Docker is a free program that lets you run other programs — like Nextcloud — in an isolated environment on your laptop. Think of virtual boxes: Nextcloud, the database, and the cache each run in their own box and do not affect anything outside it. When you are done, you throw the boxes away and your laptop is clean again.

Install Docker

Windows needs WSL 2 installed before Docker Desktop — skip this and the most common Docker error appears. It only takes a minute.

  1. Press the Windows key, type cmd, then right-click Command Prompt and choose Run as administrator. Click Yes when Windows asks for permission.
  2. Type the command below and press Enter. This installs WSL 2 with Ubuntu automatically:
    wsl --install
    
  3. When it finishes, restart your computer.
  4. After the restart, go to the Docker Desktop download page and click Download for Windows. This downloads an .exe installer.
  5. Open the downloaded file. If Windows asks "Do you want to allow this app to make changes to your device?" click Yes.
  6. Follow the steps in the installer — click OK, Next, and Finish when asked.
  7. Open Docker Desktop from the Start menu.
  8. Wait until the whale icon in the taskbar stops moving. Docker is ready.

Open a terminal

A terminal (also called a command prompt or console) is a text window where you type commands. You type a command, press Enter, and the computer runs it. You do not need to know the terminal beforehand — every command in this tutorial can be copied and pasted.

  1. Press the Windows key and type cmd.
  2. Click Command Prompt in the results, or press Enter.
  3. A black window opens — that is your Command Prompt (terminal).

Check that Docker works

Type the following in the terminal (press Enter after each line):

docker --version
docker compose version

You should see something like Docker version 27.0.3 and Docker Compose version v2.x. If you see an error, check that Docker Desktop is open and active (whale icon in the taskbar or menu bar).

Step 1: Create a working directory and the compose file

Create a directory

Type in the terminal:

mkdir conduction-demo
cd conduction-demo
  • mkdir conduction-demo creates a new folder called conduction-demo.
  • cd conduction-demo steps into that folder ("cd" stands for "change directory").

Create the compose file

The compose file tells Docker which programs to start and how they talk to each other. You create it once and never need to touch it again.

Open a text editor from the terminal so the filename and folder are set automatically — no manual navigation needed when saving:

Type in the terminal:

notepad docker-compose.yml

Windows asks whether to create the file — click Yes. Notepad opens. Paste the content below, then press Ctrl+S to save.

Copy the full text below and paste it into the editor. The correct filename (docker-compose.yml) and folder are already set — you do not need to change anything.

services:
  db:
    image: postgres:16-alpine
    restart: unless-stopped
    volumes:
      - db:/var/lib/postgresql/data
    environment:
      POSTGRES_DB: nextcloud
      POSTGRES_USER: nextcloud
      POSTGRES_PASSWORD: nextcloud

  redis:
    image: redis:7-alpine
    restart: unless-stopped

  nextcloud:
    image: nextcloud:latest
    restart: unless-stopped
    depends_on: [db, redis]
    ports:
      - "8080:80"
    volumes:
      - nextcloud:/var/www/html
      - ./apps:/var/www/html/custom_apps
    environment:
      POSTGRES_HOST: db
      POSTGRES_DB: nextcloud
      POSTGRES_USER: nextcloud
      POSTGRES_PASSWORD: nextcloud
      REDIS_HOST: redis
      NEXTCLOUD_TRUSTED_DOMAINS: "localhost nextcloud"

  notify_push:
    image: icewind1991/notify_push:latest
    restart: unless-stopped
    depends_on: [nextcloud, db, redis]
    ports:
      - "7867:7867"
    volumes:
      - nextcloud:/nextcloud:ro
    environment:
      NEXTCLOUD_URL: http://nextcloud
      DATABASE_URL: postgres://nextcloud:nextcloud@db/nextcloud
      REDIS_URL: redis://redis:6379

volumes:
  db:
  nextcloud:

The file describes four services: Nextcloud itself, a database (Postgres), a cache (Redis), and a live-update system (notify_push — also known as Client Push in the Nextcloud app store). All official, free images — Docker downloads them automatically in the next step.

Close the editor and go back to the terminal that is still open.

Step 2: Start the stack

Make sure your terminal is still in the conduction-demo folder (it will be if you just finished step 1). Type:

docker compose up -d

Docker downloads the required programs — about 750 MB the first time — and then starts them. The -d keeps everything running in the background so your terminal stays free.

Want to see what is happening behind the scenes? Follow the progress with:

docker compose logs -f nextcloud

You will see lines of text scroll by while Nextcloud sets itself up. Wait until you see a line with apache2 -D FOREGROUND or similar — that means Nextcloud is ready. Then press Ctrl+C to close the log view. The containers keep running.

Keep the terminal open — you will need it again in step 5.

Step 3: Finish the Nextcloud setup wizard

Open your web browser (Chrome, Firefox, Edge — whatever you prefer) and go to:

http://localhost:8080

You see the Nextcloud setup screen. We will create an admin account using admin as the username and admin as the password.

Nextcloud will warn you that the password is too weak — that warning is correct, but this installation runs only on your own laptop and cannot be reached by anyone else, so it is fine for a local demo. You can ignore the warning.

If you ever run a Nextcloud that others can reach — over the internet or within a network — always choose a strong, unique password. A good rule of thumb: at least 12 characters, mixing uppercase letters, numbers, and a special character.

Note: below the password field you will see a collapsed section called Storage & database. You do not need to open it — the database configuration is already taken care of through the docker-compose.yml file.

  1. Fill in admin as the username and admin as the password. Do not press Enter while filling in the fields — wait until both fields are filled in before you continue.
  2. Click Install or press Enter after filling in the password. The screen disappears immediately and Nextcloud starts installing.
  3. Wait about half a minute while Nextcloud finishes setting up.
  4. Nextcloud may ask if you want to install recommended apps. Click Skip — we will install only the Conduction apps you need in the next step.

You land on the Nextcloud dashboard, signed in as admin.

Step 4: Install the Conduction apps

First open the Nextcloud app store:

  1. Click your avatar — the circle with your initials in the top right corner of the screen.
  2. Choose Apps from the dropdown menu.
  3. In the left sidebar, click Featured apps — if you skip this the search may show no results because Nextcloud only searches within the currently active category.

Now install the Conduction apps one by one. Start with Open Register — OpenCatalogi and Open Connector both depend on it.

Note: when you click Download and enable, Nextcloud may ask you to confirm your password before it allows the installation. Enter admin and confirm.


Open Register

The foundation for all other Conduction apps. Install this one first — OpenCatalogi and Open Connector both read from it.

  1. Click the search field at the top of the Apps page (the magnifying glass icon) so the cursor appears inside it.
  2. Type Open Register — the results update as you type.
  3. Click Download and enable on the Open Register card.
  4. Wait for the installation to finish before moving on.

OpenCatalogi

Makes every register searchable as a public catalogue and federates to data.overheid.nl.

  1. Clear the search field, type OpenCatalogi, and press Enter.
  2. Click Download and enable on the OpenCatalogi card.

Open Connector

Pulls in sample data via REST, SOAP, and file drops.

  1. Clear the search field, type Open Connector, and press Enter.
  2. Click Download and enable on the Open Connector card.

After every Conduction app install, the setup runs automatically and sample data becomes visible within seconds.

Also install: Client Push

Client Push is a standard Nextcloud app — not a Conduction app — that provides live browser updates so the page refreshes automatically when data changes. You need it for step 5.

  1. Clear the search field, type Client Push, and press Enter.
  2. Click Download and enable on the Client Push card.

Step 5: Wire Client Push to the push server

This is the only step that requires a bit more terminal work. Go back to the terminal you kept open and make sure you are still in the conduction-demo folder.

Copy the commands below one line at a time, paste them into the terminal, and press Enter after each one. How to paste depends on your system:

Right-click inside the terminal window to paste. Ctrl+V may also work on Windows 10 and 11, but right-click is more reliable.

Run each command below one at a time — copy it, paste it into the terminal, and press Enter. Wait for the terminal to return a new prompt before pasting the next one.

Command 1 of 5 — tell Nextcloud which server handles the shared cache:

docker compose exec --user www-data nextcloud php occ config:system:set redis host --value redis

Command 2 of 5 — set the port for the cache server:

docker compose exec --user www-data nextcloud php occ config:system:set redis port --value 6379 --type integer

Command 3 of 5 — tell Nextcloud to use the cache for shared data:

docker compose exec --user www-data nextcloud php occ config:system:set memcache.distributed --value '\OC\Memcache\Redis'

Command 4 of 5 — mark the internal Docker network as trusted so Client Push can talk back to Nextcloud:

docker compose exec --user www-data nextcloud php occ config:system:set trusted_proxies 0 --value 172.16.0.0/12

Command 5 of 5 — register the Client Push server address with Nextcloud:

docker compose exec --user www-data nextcloud php occ notify_push:setup http://notify_push:7867

Once all five have run, check that everything is connected:

docker compose exec --user www-data nextcloud php occ notify_push:self-test

You should see a list of green checkmarks (✓). One warning about unencrypted http is expected for local use — you can ignore it. If any other item shows a red ✗, check the troubleshooting section at the bottom of this page.

What you get

Here is a quick overview of what is now running on your laptop:

Browser addresshttp://localhost:8080
First startupAbout 3 minutes (downloads ~750 MB once)
Starting again laterA few seconds
Nextcloud versionOfficial latest, identical to production
Memory usedAround 1 GB
To wipe everything and start freshRun docker compose down -v — ⚠️ deletes all data

This is a real, fully working Nextcloud — not a recording or a shared demo that can go offline.

Stopping and starting

When you are done for the day you do not need to leave everything running.

Pause for now — stops the containers but keeps all your data:

docker compose stop

Start again after pausing:

docker compose start

Wipe everything and start from scratch:

docker compose down -v

⚠️ This deletes everything. All your Nextcloud data, every installed app, every setting, and every file you uploaded will be permanently gone. There is no undo. Only run this if you are sure you want to start completely fresh.

After docker compose down -v your laptop is back to its original state. To start over, run docker compose up -d from the conduction-demo folder and go through the full setup again from step 3.

Troubleshooting

Troubleshooting

Something not working? Find the matching situation below.

The terminal does not recognise `docker`

Docker Desktop is probably not running. Open Docker Desktop and wait for the whale icon to stop moving, then try again. On Windows: close the Command Prompt and open a new one after Docker Desktop has started.

Docker Desktop fails to start on Windows with an error about virtualization or WSL 2

Virtualization is probably disabled in your computer's BIOS. The BIOS is a settings screen that exists below Windows and controls your hardware — it looks different from everything you normally see. On most modern laptops (2018+) virtualization is already on by default, so this error is uncommon.

Not comfortable making changes in the BIOS? That is completely understandable — ask someone with IT knowledge to help you with the steps below.

Step 1 — get into the BIOS. The easiest way on Windows 10 and 11:

  1. Click StartSettings (the gear icon) → SystemRecovery.
  2. Under Advanced startup, click Restart now.
  3. After the restart, click TroubleshootAdvanced optionsUEFI Firmware SettingsRestart.
  4. Your PC restarts directly into the BIOS screen.

If that option is not available, restart your computer and immediately press the key for your laptop brand — you only have a few seconds before Windows starts loading:

BrandKey
DellF2
HPF10 or Esc
LenovoF1 or F2
ASUSDel or F2
AcerDel or F2
Microsoft SurfaceHold Volume Up while pressing the power button

Not sure? Watch the screen right after startup — it usually shows a message like "Press F2 to enter Setup".

Step 2 — find the virtualization setting. Once inside the BIOS:

  1. Use the arrow keys on your keyboard to navigate — your mouse usually does not work here.
  2. Look for a tab or section called Advanced, Configuration, or CPU Configuration.
  3. Find a setting named Intel Virtualization Technology, Intel VT-x, AMD-V, SVM Mode, or Virtualization Technology.
  4. Change it from Disabled to Enabled.

Step 3 — save and exit. Press F10 to save and exit, or look for a Save & Exit tab and press Enter on Save Changes and Exit. Confirm with Yes when asked.

Important: only change the virtualization setting. Do not touch anything else.

Your computer will restart. Open Docker Desktop and it should start normally now.

Docker Desktop shows "WSL 2 installation is incomplete"

Open Command Prompt as administrator and run wsl --update, then restart Docker Desktop.

`http://localhost:8080` does not open in the browser

The port may already be in use by another program. Open docker-compose.yml in your text editor, change "8080:80" to "8081:80", save, and try http://localhost:8081 instead.

The Nextcloud setup screen appears again after you already finished it

The database was wiped, probably after a docker compose down -v. Run docker compose up -d to start fresh — you will need to go through the setup wizard again.

Nextcloud shows a "Trusted domain" error after opening the browser

The address you are using is not on Nextcloud's allowed list. Open docker-compose.yml, find NEXTCLOUD_TRUSTED_DOMAINS, add your address to the value (space-separated), save, and run docker compose up -d.

"Download and enable" in the app store does nothing or shows an error

Nextcloud may not be able to reach the internet. This sometimes happens on corporate networks. Try switching to a mobile hotspot to confirm, then ask your IT department about proxy settings.

Client Push self-test fails with `push server can't connect to the Nextcloud server` or `nextcloud is not configured as a trusted domain`

The internal hostname nextcloud is missing from Nextcloud's trusted list. Run this one command to fix it:

docker compose exec --user www-data nextcloud php occ config:system:set trusted_domains 1 --value nextcloud

Then re-run command 5 from step 5. If you are starting fresh, this is already fixed in the docker-compose.yml above.

Client Push self-test fails with `is not trusted as a reverse proxy`

The internal Docker network address range on your machine is different from the default. This is rare — if it happens, contact us and we will help you sort it out.

Client Push keeps restarting after `docker compose up -d`

Run docker compose logs notify_push and look for × No redis server is configured. If you see it, run commands 1, 2, and 3 from step 5 again, then restart with:

docker compose up -d notify_push

Next step

A working Nextcloud is the entry point for the other tutorials in this series.

Send the docker-compose.yml to a colleague if you want to see this work together.