Install owncloud on NAT VPS as a private cloud


Natvps.id – owncloud is a platform Open-source To share and save files independently on private or organizational servers. With owncloud, users can manage documents, images, and other data through a safe web interface, and synchronize to various devices such as desktop and mobile. owncloud is a popular alternative to services cloud commercial because it provides full control over data, flexibility, and more guaranteed privacy. Owncloud can also be an alternative to Nextcloud.

This article discusses the steps to install owncloud on NAT VPS using a docker, along with the Nginx configuration for reverse-proxy. This article uses Ubuntu 22.04 as a reference, but you can use other distributions such as Debian and Centos. Make sure the OS used supports the docker.

Port forwarding configuration

Considering we use grout, we need to add 2 Port Forwarding Configuration on the virtualizor panel (or other VPS panels according to the provider), namely Port Forwarding HTTP and HTTPS As its own domain.

For example, in this article will use a domain Awan.tutorial.mdinata.my.id To access Owncloud. You are free to change the domain according to your choice. Record this port and domain, because we will use it again in the deploy process.

Don’t forget to add DNS Records to go to your NAT VPS public IP, like this:

Install Docker

We will use a docker and compile a docker for spread He spoke.

First, install curly Using Orders:

apt update && apt install curl -y

Then, run manuscript Automatic installation from the docker by entering:

curl -fsSL get.docker.com | sh

Wait until the installation process is complete.

Spreading owncloud

Create a new directory:

mkdir owncloud
cd owncloud/

Then, create a file docker-compose.yml use Nano:

apt install nano -y # jika belum
nano docker-compose.yml

Then, stick the following configuration:

# 
# Reference: 

version: "3"

volumes:
  files:
    driver: local
  mysql:
    driver: local
  redis:
    driver: local

services:
  owncloud:
    image: owncloud/server:${OWNCLOUD_VERSION:-latest}
    container_name: owncloud_server
    restart: always
    ports:
      - ${HTTP_PORT}:8080
    depends_on:
      - mariadb
      - redis
    environment:
      - OWNCLOUD_DOMAIN=${OWNCLOUD_DOMAIN}
      - OWNCLOUD_TRUSTED_DOMAINS=${OWNCLOUD_TRUSTED_DOMAINS}
      - OWNCLOUD_DB_TYPE=mysql
      - OWNCLOUD_DB_NAME=owncloud
      - OWNCLOUD_DB_USERNAME=owncloud
      - OWNCLOUD_DB_PASSWORD=owncloud
      - OWNCLOUD_DB_HOST=mariadb
      - OWNCLOUD_ADMIN_USERNAME=${ADMIN_USERNAME}
      - OWNCLOUD_ADMIN_PASSWORD=${ADMIN_PASSWORD}
      - OWNCLOUD_MYSQL_UTF8MB4=true
      - OWNCLOUD_REDIS_ENABLED=true
      - OWNCLOUD_REDIS_HOST=redis
    healthcheck:
      test: ["CMD", "/usr/bin/healthcheck"]
      interval: 30s
      timeout: 10s
      retries: 5
    volumes:
      - files:/mnt/data

  mariadb:
    image: mariadb:10.11 # minimum required ownCloud version is 10.9
    container_name: owncloud_mariadb
    restart: always
    environment:
      - MYSQL_ROOT_PASSWORD=owncloud
      - MYSQL_USER=owncloud
      - MYSQL_PASSWORD=owncloud
      - MYSQL_DATABASE=owncloud
      - MARIADB_AUTO_UPGRADE=1
    command: ["--max-allowed-packet=128M", "--innodb-log-file-size=64M"]
    healthcheck:
      test: ["CMD", "mysqladmin", "ping", "-u", "root", "--password=owncloud"]
      interval: 10s
      timeout: 5s
      retries: 5
    volumes:
      - mysql:/var/lib/mysql

  redis:
    image: redis:6
    container_name: owncloud_redis
    restart: always
    command: ["--databases", "1"]
    healthcheck:
      test: ["CMD", "redis-cli", "ping"]
      interval: 10s
      timeout: 5s
      retries: 5
    volumes:
      - redis:/data

Save the file with CTRL-X, Y, then enter.

Next, create a file .env which contains owncloud configuration:

nano .env
OWNCLOUD_VERSION=""     # Kosongkan jika ingin menggunakan versi terbaru ownCloud
OWNCLOUD_DOMAIN=awan.tutorial.mdinata.my.id
OWNCLOUD_TRUSTED_DOMAINS=localhost, awan.tutorial.mdinata.my.id
ADMIN_USERNAME=admin
ADMIN_PASSWORD=admin
HTTP_PORT=8080
  • Owncloud_version: The owner of the owner that you want to use. Blank if you want to always use the latest version
  • Owncloud_domain: Fill in the owlloud domain that you want to use
  • Owncloud_triited_domains: At the end, also add your owncloud domain
  • Admin_username: Admin User Name
  • Admin_password: Admin Password

Save the file.

Finally, run Owncloud:

docker compose up -d

Wait until the process spread finished.

Nginx Configuration (Reverse Proxy)

So that we can access the URL through a domain like monitor.tutorial.mdinata.my.idwe can use Reverse Proxy Like Nginx.

First, install Nginx through the command:

# Hapus Apache2 dan pendukungnya (biasanya terpasang secara bawaan di VPS OpenVZ)
apt purge apache2* -y

# Install NGINX
apt install nginx -y

Create a new host configuration specifically for owncloud:

nano /etc/nginx/sites-available/owncloud

Then stick the following configuration:

server {
        listen 80;
        server_name awan.tutorial.mdinata.my.id;
        client_max_body_size 10M;

        location / {
                # check 
                proxy_set_header Connection '';
                proxy_http_version 1.1;
                proxy_read_timeout 360s;

                proxy_set_header Host $host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header X-Forwarded-Proto $scheme;

                proxy_pass 
        }
}

Adjust awan.tutorial.mdinata.my.id with your domain.

Activate the configuration with:

ln -sf /etc/nginx/sites-available/owncloud /etc/nginx/sites-enabled/owncloud

# Restart NGINX
systemctl restart nginx

Produce SSL certificate (let’s encryption)

So that our domain can be accessed through HTTPS, we need to make a SSL certificate. We can use a free SSL certificate from Let’s Encrypt through Certbot.

Install Certbot and Nginx plugin use the command:

apt install python3-certbot python3-certbot-nginx

So, produce Certificate through Certbot with the command

certbot --nginx -d awan.tutorial.mdinata.my.id

Change awan.tutorial.mdinata.my.id with your domain.

Happy! Your current domain can be accessed via a safe connection https.

Login Own Coloud

Login owncloud via your domain, with username & password according to the previous configuration.

Cover

Thus this article is about the steps to install owncloud on NAT VPS. If you are confused or doubtful, don’t hesitate to ask questions in the telegram group @ipv6indonesia. Thank You!



Game Center

Game News

Review Film
Rumus Matematika
Anime Batch
Berita Terkini
Berita Terkini
Berita Terkini
Berita Terkini
review anime

Gaming Center