How to Run .devcontainer

I just wanted to share how I finally solved this — “How to Run the Nextcloud .devcontainer.”

I spent way too much time figuring this out…
I already wrote a full guide on my blog, but it’s in Korean.
(You can also find the full version here if you’re interested: https://ratatou2.tistory.com/277)

So here’s a short summary in English.

1. Clone the Nextcloud Server Repository

git clone https://github.com/nextcloud/server.git
cd server

2. Edit .devcontainer/docker-compose.yml

cd .devcontainer
sudo vim docker-compose.yml

If you don’t already have any containers or services running on your server,
you don’t need to change anything.

In my case, ports 80 and 8080 were already in use,
so I changed the port numbers in the file.

3. Install the 3rdparty Submodules

# In server directory
git submodule update --init

This installs required dependencies for the devcontainer.

4. Make some directory and Give Authority

mkdir data
sudo chown -R 1001:1001 ./data ./config ./apps

This step took me the most time to figure out.
The key is that the container’s internal user is devcontainer (UID 1001),
so you must match that UID on your host system.

(Thanks to Lewy for sharing this solution!)

5. Run the Container

docker compose -f .devcontainer/docker-compose.yml up -d

6. Access Nextcloud

http://<your-server-ip>:<port>
e.g. http://192.168.0.222:11111
1 Like

Nice write up :slight_smile:
Glad I could help.

1 Like