Skip to content
Follow
CMS

How to install ownCloud with Apache on Ubuntu 24.04

Richard
Written by
Richard
Jun 4, 2024 Updated Jun 20, 2026 6 min read
ownCloud featured image
ownCloud featured image

You can install ownCloud with Apache on Ubuntu 24.04 to create your private cloud storage solution.

ownCloud is a popular open-source file-sharing and synchronization software that allows you to store and access your files from anywhere. Installing it with Apache, a widely-used web server, on Ubuntu 24.04 provides a robust platform for your personal cloud.

This tutorial guides you through setting up ownCloud on Ubuntu 24.04, specifically leveraging Apache for web server functionality. By following these steps, you’ll have your own secure and private cloud up and running.

⚡ Quick Answer

Install Apache, MariaDB, and PHP using apt commands. Create an ownCloud database in MariaDB, then download and extract the ownCloud files to the Apache web root directory.

Install Apache HTTP server on Ubuntu

You’ll need a web server to run ownCloud, and Apache is a great choice for Ubuntu 24.04.

To do that, open the Ubuntu terminal and run the commands below to install the Apache web server.

🐧Bash / Shell
sudo apt update
sudo apt install apache2

Once Apache is installed, the commands below can start, stop, and enable the Apache web server to start automatically when your server boots up.

🐧Bash / Shell
sudo systemctl stop apache2
sudo systemctl start apache2
sudo systemctl enable apache2

You can test that the Apache web server is running by opening your web browser and browsing to the server’s localhost or IP address.

http://localhost

Apache2 default landing page confirming successful installation on Ubuntu 24.04
Apache2 default landing page confirming successful installation on Ubuntu 24.04

When you see the Apache2 Default Page, it means the Apache HTTP server is successfully installed.

Additional help on installing Apache on Ubuntu is in the link below.

How to install Apache on Ubuntu

Install MariaDB database server on Ubuntu Linux

ownCloud needs a database to store its information, and MariaDB is a popular and reliable option for Ubuntu Linux.

To install and use the MariaDB database server, use the instructions below.

Open the Ubuntu terminal and run the commands below to install the MariaDB database server.

🐧Bash / Shell
sudo apt update
sudo apt install mariadb-server

Once the MariaDB database server is installed, use the commands below to stop, start, and enable the MariaDB server to start automatically when the server boots.

🐧Bash / Shell
sudo systemctl stop mariadb
sudo systemctl start mariadb
sudo systemctl enable mariadb

Run the following commands to validate and test if the MariaDB database server is installed successfully.

🐧Bash / Shell
sudo mariadb

Once you run the commands above, it will log you onto the MariaDB console and display a message similar to the one below.

💻Code
Welcome to the MariaDB monitor.  Commands end with ; or g.
Your MariaDB connection id is 32
Server version: 10.11.2-MariaDB-1 Ubuntu 23.04

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.

MariaDB [(none)]> 

The message tells you that the server is installed successfully.

Additional help on installing MariaDB.

Create an ownCloud database

After setting up MariaDB, you need to create a specific database and user for ownCloud to use.

As part of the setup, we will create a database named ‘ownclouddb‘ and a corresponding user account called ‘ownclouddbuser.’

Finally, we’ll grant the ownclouddbuser full access to the ownclouddb database.

All the database steps above can be done using the commands below:

But first, log on to the MariaDB database server:

🐧Bash / Shell
sudo mariadb

Then run the commands below to complete the steps:

💻Code
CREATE DATABASE ownclouddb CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
CREATE USER ownclouddbuser@localhost IDENTIFIED BY 'type_your_password_here';
GRANT ALL ON ownclouddb.* TO ownclouddbuser@localhost WITH GRANT OPTION;
FLUSH PRIVILEGES;
exit

Ensure to replace ‘type_your_password_here ‘with your password.

Install PHP on Ubuntu Linux

ownCloud is built using PHP, so you’ll need to install a compatible version on your Ubuntu Linux system.

ownCloud runs with the following PHP versions: 7.4. Note that PHP 8.x is currently not supported. Always check the PHP requirements page to ensure you’re installing the latest version.

Run the commands below to install PHP 7.4.

First, add the following repository.

🐧Bash / Shell
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:ondrej/php

Then, install PHP 7.4 using the command below.

🐧Bash / Shell
sudo apt install php7.4 libapache2-mod-php7.4 php7.4-intl php7.4-mysql php7.4-curl php7.4-cli php7.4-zip php7.4-xml php7.4-gd php7.4-gmp php7.4-common php7.4-mbstring php7.4-xmlrpc php7.4-json php7.4-sqlite3 php7.4-ldap php7.4-imap php7.4-pgsql php7.4-ssh2 php7.4-soap php7.4-zip

Additional help on installing PHP

How to install PHP on Ubuntu Linux

Download ownCloud files

Now it’s time to get the actual ownCloud software onto your Ubuntu server.

Always check the download page for the latest release. Replace the download link below with the current so you have the latest version.

First, navigate to the /tmp/ directory and download ownCloud files. After unzipping the file, move the content into the ownCloud folder in the Apache root directory.

The final step is to change the permissions. This will allow the Apache web server to safely interact with the files, ensuring a secure environment for your ownCloud installation.

💻Code
wget https://download.owncloud.com/server/stable/owncloud-complete-20240226.zip -P /tmp
sudo unzip /tmp/owncloud-complete-20240226.zip -d /var/www
sudo chown -R www-data:www-data /var/www/owncloud/

Once all the steps are done, configure the Apache webserver to serve the ownCloud content.

Run the commands below to create an Apache virtual host file for ownCloud.

🐧Bash / Shell
sudo nano /etc/apache2/sites-available/owncloud.conf

Then, copy and paste the content block below into the Apache server block.

💻Code
Alias /owncloud "/var/www/owncloud/"

<Directory /var/www/owncloud/>
Options +FollowSymlinks
AllowOverride All

<IfModule mod_dav.c>
Dav off
</IfModule>

SetEnv HOME /var/www/owncloud
SetEnv HTTP_HOME /var/www/owncloud

</Directory>

Save the file.

Then, run the commands below to enable the virtual host and restart the Apache server.

🐧Bash / Shell
sudo a2ensite owncloud.conf
sudo a2enmod env rewrite dir mime headers setenvif ssl
sudo systemctl restart apache2

Setup Let’s Encrypt SSL/TLS for ownCloud

To keep your ownCloud data safe and secure, you should set up an SSL/TLS certificate, and Let’s Encrypt makes this easy.

Please read the post below for additional resources on installing and creating Let’s Encrypt SSL certificates for Apache.

How to set up Let’s Encrypt SSL certificate for Apache on Ubuntu Linux

Once you have restarted the Apache web server, open your browser and browse to the server hostname or IP address defined in the Apache server block.

💻Code
http://localhost/owncloud

An ownCloud installation wizard page should appear. Create an administrator account and password, enter the database name, database account name, and password created above, and click Finish setup.

owncloud installation wizard finish
owncloud installation wizard finish

Your ownCloud site should be ready to use.

owncloud dashboard
owncloud dashboard

Set up a reverse proxy for ownCloud

Setting up a reverse proxy with Apache lets you use a custom domain name for your ownCloud server, making it easier to access.

The links below should help you set that up.

That should do it!

Conclusion:

  • Installing and configuring ownCloud with Apache support on Ubuntu 24.04 ensures enhanced user experience and seamless integration with the popular web server, improving performance, stability, and security.
  • The step-by-step guide detailed instructions on installing the necessary components, including Apache HTTP server, MariaDB database server, and PHP on Ubuntu Linux.
  • It thoroughly explained how to create and configure your ownCloud database, download your ownCloud files, set up Let’s Encrypt SSL/TLS for yourCloud, and optionally set up a reverse proxy with Nginx or Apache.
  • Using the provided resources and following the instructions will result in a fully functional ownCloud site ready for Ubuntu with Apache support.

Was this guide helpful?

Was this helpful?
Richard

About the Author

Richard

Tech Writer, IT Professional

Richard, a writer for Geek Rewind, is a tech enthusiast who loves breaking down complex IT topics into simple, easy-to-understand ideas. With years of hands-on experience in system administration and enterprise IT operations, he’s developed a knack for offering practical tips and solutions. Richard aims to make technology more accessible and actionable. He's deeply committed to the Geek Rewind community, always ready to answer questions and engage in discussions.

📚 Related Tutorials

Install Symfony 5 on Ubuntu with Apache
Ubuntu Linux Install Symfony 5 on Ubuntu with Apache
How to Install Syncthing on Ubuntu 24.04
Ubuntu Linux How to Install Syncthing on Ubuntu 24.04
How to Install GNOME Desktop on Ubuntu 24.04
Ubuntu Linux How to Install GNOME Desktop on Ubuntu 24.04
How to Install KDE Desktop on Ubuntu 24.04
Ubuntu Linux How to Install KDE Desktop on Ubuntu 24.04

No comments yet — be the first to share your thoughts!

Leave a Comment

Your email address will not be published. Required fields are marked *