Storage Guide

    Self-Hosted ownCloud

    Deploy your own file synchronization and sharing platform with ownCloud on RamNode VPS. Complete privacy, powerful features, and full control.

    Ubuntu 22.04
    LAMP Stack
    ⏱️ 30-45 minutes

    Prerequisites & VPS Selection

    Before starting this deployment, ensure you have:

    • Ubuntu 22.04 LTS installed
    • Root or sudo access to your server
    • A registered domain name pointed to your VPS IP address
    • Basic familiarity with Linux command line operations

    Personal Use

    • • 2GB RAM (min)
    • • 1 vCPU
    • • 1-5 users

    Recommended

    • • 4GB RAM
    • • 2 vCPU
    • • 5-25 users

    Enterprise

    • • 8GB+ RAM
    • • 4+ vCPU
    • • 25+ users
    2

    Update Your System

    Connect to your VPS via SSH and update all system packages:

    Update System
    sudo apt update && sudo apt upgrade -y
    3

    Install Required Dependencies

    ownCloud requires a LAMP stack with specific PHP extensions:

    Install LAMP Stack and PHP Extensions
    sudo apt install -y apache2 mariadb-server libapache2-mod-php8.1 \
      php8.1-gd php8.1-mysql php8.1-curl php8.1-mbstring \
      php8.1-intl php8.1-gmp php8.1-bcmath php8.1-xml \
      php8.1-zip php8.1-imagick php8.1-redis redis-server \
      unzip wget
    Enable Apache Modules
    sudo a2enmod rewrite headers env dir mime
    4

    Configure MariaDB

    Secure your MariaDB installation:

    Secure MariaDB
    sudo mysql_secure_installation

    Follow the prompts to set a root password, remove anonymous users, disallow remote root login, and remove the test database.

    Create Database and User
    sudo mysql -u root -p
    SQL Commands
    CREATE DATABASE owncloud;
    CREATE USER 'owncloud'@'localhost' IDENTIFIED BY 'your_secure_password';
    GRANT ALL PRIVILEGES ON owncloud.* TO 'owncloud'@'localhost';
    FLUSH PRIVILEGES;
    EXIT;

    ⚠️ Important: Replace 'your_secure_password' with a strong, unique password!

    5

    Configure PHP

    Edit the PHP configuration file to optimize for ownCloud:

    Edit PHP Config
    sudo nano /etc/php/8.1/apache2/php.ini
    PHP Configuration Values
    memory_limit = 512M
    upload_max_filesize = 512M
    post_max_size = 512M
    max_execution_time = 300
    date.timezone = America/New_York
    opcache.enable=1
    opcache.interned_strings_buffer=8
    opcache.max_accelerated_files=10000
    opcache.memory_consumption=128
    opcache.save_comments=1
    opcache.revalidate_freq=1

    Adjust date.timezone to match your location. Save and exit (Ctrl+X, Y, Enter).

    6

    Download and Install ownCloud

    Download the latest stable version:

    Download ownCloud
    cd /tmp
    wget https://download.owncloud.com/server/stable/owncloud-complete-latest.tar.bz2
    Extract and Set Permissions
    sudo tar -xjf owncloud-complete-latest.tar.bz2 -C /var/www/
    sudo chown -R www-data:www-data /var/www/owncloud
    sudo chmod -R 755 /var/www/owncloud
    7

    Configure Apache Virtual Host

    Create a new Apache configuration file:

    Create Apache Config
    sudo nano /etc/apache2/sites-available/owncloud.conf
    Apache Virtual Host Configuration
    <VirtualHost *:80>
        ServerName cloud.yourdomain.com
        DocumentRoot /var/www/owncloud
    
        <Directory /var/www/owncloud/>
            Options +FollowSymlinks
            AllowOverride All
            Require all granted
    
            <IfModule mod_dav.c>
                Dav off
            </IfModule>
    
            SetEnv HOME /var/www/owncloud
            SetEnv HTTP_HOME /var/www/owncloud
        </Directory>
    
        ErrorLog ${APACHE_LOG_DIR}/owncloud_error.log
        CustomLog ${APACHE_LOG_DIR}/owncloud_access.log combined
    </VirtualHost>
    Enable Site
    sudo a2ensite owncloud.conf
    sudo a2dissite 000-default.conf
    sudo systemctl reload apache2
    8

    Install SSL Certificate

    Secure your ownCloud installation with Let's Encrypt:

    Install Certbot and Get SSL
    sudo apt install -y certbot python3-certbot-apache
    sudo certbot --apache -d cloud.yourdomain.com

    ✅ Follow the prompts to complete SSL setup. Certbot will auto-configure Apache.

    9

    Complete Web-Based Installation

    Open your browser and navigate to https://cloud.yourdomain.com. Configure:

    1. Admin Account: Create an administrator username and password
    2. Data Folder: Leave as default (/var/www/owncloud/data) or specify custom location
    3. Database Configuration:
      • Database user: owncloud
      • Database password: The password you created in Step 4
      • Database name: owncloud
      • Database host: localhost

    Click "Finish setup" and wait for the installation to complete.

    10

    Configure Redis for File Locking

    Enable Redis for improved performance and file locking:

    Edit ownCloud Config
    sudo nano /var/www/owncloud/config/config.php
    Add Redis Configuration (before closing );)
    'memcache.local' => '\OC\Memcache\Redis',
    'memcache.locking' => '\OC\Memcache\Redis',
    'redis' => [
        'host' => 'localhost',
        'port' => 6379,
    ],

    Configure Trusted Domains

    In the same config.php, ensure your domain is listed:

    Trusted Domains Array
    'trusted_domains' =>
    array (
        0 => 'localhost',
        1 => 'cloud.yourdomain.com',
        2 => 'your.server.ip.address',
    ),

    Set Up Cron Jobs

    Configure Background Tasks
    sudo crontab -u www-data -e
    # Add this line:
    */15 * * * * /usr/bin/php8.1 -f /var/www/owncloud/cron.php

    In ownCloud web interface, go to Settings → Admin → Basic settings, and select "Cron" as the background jobs method.

    11

    Production Optimization

    Configure Firewall

    Allow HTTP/HTTPS Traffic
    sudo ufw allow 'Apache Full'
    sudo ufw enable

    Enable HSTS

    Edit Apache SSL Config
    sudo nano /etc/apache2/sites-available/owncloud-le-ssl.conf
    # Add inside <VirtualHost *:443>:
    Header always set Strict-Transport-Security "max-age=15552000; includeSubDomains"
    
    sudo systemctl reload apache2

    Increase MySQL Performance

    MariaDB Optimization
    sudo nano /etc/mysql/mariadb.conf.d/50-server.cnf
    # Add under [mysqld]:
    innodb_buffer_pool_size = 512M
    innodb_log_file_size = 128M
    innodb_flush_method = O_DIRECT
    innodb_flush_log_at_trx_commit = 2
    
    sudo systemctl restart mariadb
    12

    Backup & Maintenance

    Backup Script (owncloud-backup.sh)
    #!/bin/bash
    BACKUP_DIR="/backup/owncloud"
    DATE=$(date +%Y%m%d_%H%M%S)
    
    # Create backup directory
    mkdir -p $BACKUP_DIR
    
    # Backup database
    mysqldump -u root -p'your_mysql_root_password' owncloud > $BACKUP_DIR/owncloud_db_$DATE.sql
    
    # Backup data and config
    tar -czf $BACKUP_DIR/owncloud_files_$DATE.tar.gz /var/www/owncloud/data /var/www/owncloud/config
    
    # Keep only last 7 days of backups
    find $BACKUP_DIR -type f -mtime +7 -delete
    Setup Automated Backups
    sudo chmod +x /usr/local/bin/owncloud-backup.sh
    sudo crontab -e
    # Add: 0 2 * * * /usr/local/bin/owncloud-backup.sh

    Monitor Logs

    View Logs
    # Apache logs
    sudo tail -f /var/log/apache2/owncloud_error.log
    
    # ownCloud logs
    sudo tail -f /var/www/owncloud/data/owncloud.log

    Check for Updates

    Check Updates
    sudo -u www-data php occ update:check
    13

    Troubleshooting

    Security Hardening

    • Enable Two-Factor Authentication via the TOTP app from ownCloud marketplace
    • Configure server-side encryption in Settings → Admin → Encryption
    • Install the "Brute-force settings" app to limit login attempts

    Deployment Complete!

    You now have a fully functional ownCloud installation on your RamNode VPS. This self-hosted solution provides enterprise-grade file synchronization and sharing while maintaining complete control over your data.

    Download desktop and mobile clients from owncloud.com to sync across all your devices.

    Ready to Deploy ownCloud?

    Get started with a RamNode VPS and own your cloud storage today.

    View VPS Plans