Hey Devs ๐,
In this post, Iโll guide you through deploying OwnCloud on a GCP VM instance using Docker, secured with NGINX as a reverse proxy and HTTPS enabled via Let's Encrypt.
๐งฐ What Youโll Need
- Google Cloud Platform (GCP) account
- Basic Linux & Docker knowledge
- Domain name (e.g.,
ceritadesain.com
) - SSH access to your VM
๐ฆ Step 1: Create a GCP VM Instance
- Go to Google Cloud Console
- Navigate to:
Compute Engine > VM instances
- Create a new instance:
- OS: Ubuntu 22.04 LTS
- Firewall: Allow HTTP & HTTPS
- SSH into your instance once itโs running.
๐ณ Step 2: Install Docker & Docker Compose
sudo apt update
sudo apt install docker.io docker-compose -y
sudo systemctl enable docker
sudo usermod -aG docker $USER
๐ Logout and login again to apply Docker group permissions.
๐ Step 3: Setup OwnCloud with Docker Compose
Create a folder for the project:
mkdir owncloud-docker && cd owncloud-docker
Create a docker-compose.yml
:
version: '3.1'
services:
owncloud:
image: owncloud/server
restart: always
ports:
- 8080:8080
environment:
- OWNCLOUD_DOMAIN=ceritadesain.com
- OWNCLOUD_ADMIN_USERNAME=admin
- OWNCLOUD_ADMIN_PASSWORD=yourpassword
volumes:
- files:/mnt/data
volumes:
files:
Run:
docker-compose up -d
You can now access it at http://your-external-ip:8080
.
๐ Step 4: Point Your Domain to the VM IP
On your domain provider, update the A record to point to your GCP VM's external IP.
Example:
A @ -> 34.100.xxx.xxx
๐ Step 5: Setup NGINX Reverse Proxy + SSL
Install NGINX and Certbot:
sudo apt install nginx certbot python3-certbot-nginx -y
Create an NGINX config:
sudo nano /etc/nginx/sites-available/owncloud
Paste this:
server {
listen 80;
server_name ceritadesain.com;
location / {
proxy_pass http://localhost:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
}
Enable it:
sudo ln -s /etc/nginx/sites-available/owncloud /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl restart nginx
Add HTTPS via Certbot:
sudo certbot --nginx -d ceritadesain.com
Done! ๐ Now your OwnCloud is accessible via https://ceritadesain.com
๐ง Bonus Tips
- Use Docker volumes for persistent data.
- Set up automatic SSL renewal with:
sudo crontab -e
Add:
0 0 * * * certbot renew --quiet
๐ค Letโs Connect!
If you found this helpful, feel free to comment or connect with me on LinkedIn or GitHub. I'm always up for feedback or collaboration on DevOps, web, and ML projects.
Top comments (0)