How to Install OpenCloud using Nginx on Ubuntu 24.04

OpenCloud is a self-hosted cloud platform similar to Nextcloud, offering file storage, collaboration apps, office editing, and more, all in your own server environment.

Prerequisites

Update System Packages

We update the server packages to ensure everything is current and compatible.

apt update && sudo apt upgrade -y

We install curl and CA certificates used during installation.

apt install curl ca-certificates -y

Install Docker

We need Docker to run OpenCloud in containers.

curl -fsSL https://get.docker.com | sh

Enable and start Docker:

systemctl enable --now docker

Install Docker Compose

Docker Compose manages multi-container applications.

apt install docker-compose-plugin -y

Download OpenCloud Compose Files

This downloads the OpenCloud deployment files.

git clone https://github.com/opencloud-eu/opencloud-compose.git

Output:

root@vps:~# git clone https://github.com/opencloud-eu/opencloud-compose.git
Cloning into 'opencloud-compose'...
remote: Enumerating objects: 630, done.
remote: Counting objects: 100% (268/268), done.
remote: Compressing objects: 100% (160/160), done.
remote: Total 630 (delta 207), reused 117 (delta 103), pack-reused 362 (from 2)
Receiving objects: 100% (630/630), 435.29 KiB | 7.14 MiB/s, done.
Resolving deltas: 100% (287/287), done.

Go into the directory:

cd opencloud-compose

Copy the example environment file:

cp .env.example .env

Edit Environment Configuration

Set your domain in the .env file.

nano .env

Find and update:

OC_DOMAIN=wiki2.domainhere.info
INITIAL_ADMIN_PASSWORD=YourSecurePasswordHere

Note: Replace the wiki2.domainhere.info with actual domain name and password with strong password

Save & Exit: CTRL + X, press Y, then ENTER.

Edit your docker-compose.yml:

nano docker-compose.yml

Add Ports section below the image part.

ports:
  - "9200:9200"

Save and exit.

Start OpenCloud

Run containers in background:

docker compose up -d

Check if running:

docker ps

Output:


root@vps:~/opencloud-compose# docker ps
CONTAINER ID   IMAGE                                  COMMAND                  CREATED          STATUS          PORTS                                         NAMES
9a1676d3c6ba   opencloudeu/opencloud-rolling:latest   "/bin/sh -c 'openclo…"   43 seconds ago   Up 42 seconds   0.0.0.0:9200->9200/tcp, [::]:9200->9200/tcp   opencloud-compose-opencloud-1 

Install Nginx

Install Nginx to forward the domain to OpenCloud container.

apt install nginx -y

Create Nginx Host File:

nano /etc/nginx/sites-available/wiki2.domainhere.info

Paste this:

server {
    listen 80;
    server_name wiki2.domainhere.info;

    location / {
        proxy_pass http://127.0.0.1:9200;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
    }
}

Enable the site:

ln -s /etc/nginx/sites-available/wiki2.domainhere.info /etc/nginx/sites-enabled/
systemctl restart nginx

Enable HTTPS

Use Let’s Encrypt for free SSL:

snap install core; snap refresh core
apt remove certbot -y
snap install --classic certbot
export PATH=$PATH:/snap/bin
certbot --nginx -d wiki2.domainhere.info

Configure Firewall (UFW)

If the firewall (UFW) is enabled, allow Nginx and OpenCloud ports.

ufw allow OpenSSH
ufw allow 'Nginx Full'
ufw allow 9200/tcp
ufw enable

Verify:

ufw status

Output:

root@vps:~/opencloud-compose# ufw status
Status: active

To                         Action      From
--                         ------      ----
OpenSSH                    ALLOW       Anywhere                  
9200/tcp                   ALLOW       Anywhere                  
Nginx Full                 ALLOW       Anywhere                  
OpenSSH (v6)               ALLOW       Anywhere (v6)             
9200/tcp (v6)              ALLOW       Anywhere (v6)             
Nginx Full (v6)            ALLOW       Anywhere (v6)             

root@vps:~/opencloud-compose# 

Access Dashboard

After setup completes, open:

https://wiki2.domainhere.info

Login using admin name and the password you've set.

images

Dashboard

– You’ll see your main workspace and apps

images

Conclusion

You have successfully installed OpenCloud on Ubuntu 24.04 using Docker and Nginx.


CrownCloud - Get a SSD powered KVM VPS at $4.5/month!
Use the code WELCOME for 10% off!

1 GB RAM / 25 GB SSD / 1 CPU Core / 1 TB Bandwidth per month

Available Locations: LAX | MIA | ATL | FRA | AMS