How to Set Up a Zero-Cost Personal Cloud on Ubuntu Using Nextcloud
- Jul 27, 2025
- 2 min read
Updated: Aug 4, 2025
Introduction
Setting up a personal cloud using Nextcloud on Ubuntu can be a cost-effective way to manage your files, calendars, and contacts. This guide will walk you through the steps to create a zero-cost personal cloud.

Prerequisites
Before you start, ensure you have the following:
An Ubuntu server (18.04 or later) or a desktop version
Basic knowledge of the command line
Access to the terminal with sudo privileges
A domain name (optional, but recommended for easier access)
Step 1: Update Your System
Open your terminal and update your system packages:
sudo apt update && sudo apt upgrade -yStep 2: Install Required Packages
Nextcloud requires a web server, PHP, and a database. Install the necessary packages:
sudo apt install apache2 mysql-server php libapache2-mod-php php-mysql php-xml php-mbstring php-curl php-zip php-gd php-intl php-json -yStep 3: Configure MySQL Database
Secure your MySQL installation and create a database for Nextcloud:
sudo mysql_secure_installationLog into MySQL:
sudo mysql -u root -pThen run the following commands to create a database and user:
CREATE DATABASE nextcloud;
CREATE USER 'nextclouduser'@'localhost' IDENTIFIED BY 'your_password';
GRANT ALL PRIVILEGES ON nextcloud.* TO 'nextclouduser'@'localhost';
FLUSH PRIVILEGES;
EXIT;Step 4: Download Nextcloud
Navigate to the web directory and download Nextcloud:
cd /var/www/html
sudo wget https://download.nextcloud.com/server/releases/nextcloud-XX.X.X.zipReplace `XX.X.X` with the latest version number. Then, unzip the downloaded file:
sudo apt install unzip
sudo unzip nextcloud-XX.X.X.zip
sudo chown -R www-data:www-data nextcloud
sudo chmod -R 755 nextcloudStep 5: Configure Apache
Create a new Apache configuration file for Nextcloud:
sudo nano /etc/apache2/sites-available/nextcloud.confAdd the following configuration:
<VirtualHost *:80>
ServerName your_domain.com
DocumentRoot /var/www/html/nextcloud
<Directory /var/www/html/nextcloud>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/nextcloud_error.log
CustomLog ${APACHE_LOG_DIR}/nextcloud_access.log combined
</VirtualHost>Enable the new configuration and required Apache modules:
sudo a2ensite nextcloud
sudo a2enmod rewrite headers env dir mime
sudo systemctl restart apache2Step 6: Complete Nextcloud Installation
Open your web browser and navigate to `http://your_domain.com` or `http://your_server_ip/nextcloud`. You will be prompted to create an admin account and enter the database details:
Database user: nextclouduser
Database password: your_password
Database name: nextcloud
Database host: localhost
After filling in the details, click on "Finish setup."
Step 7: Secure Your Nextcloud with HTTPS (Optional but Recommended)
To secure your Nextcloud instance, you can use Let's Encrypt to obtain a free SSL certificate. Install Certbot:
sudo apt install certbot python3-certbot-apache -yThen, run Certbot to obtain and install the certificate:
sudo certbot --apache -d your_domain.comFollow the prompts to complete the SSL setup.
Conclusion
You have successfully set up a zero-cost personal cloud using Nextcloud on Ubuntu. You can now access your files from anywhere and enjoy the benefits of a self-hosted cloud storage solution. Be sure to keep your Nextcloud and server updated for security and performance.


Comments