ownCloud is a free and open-source cloud platform that lets you store, share, and access your data from anywhere around the world. In this tutorial, we will show you how to install ownCloud on the latest version of POP! OS using the command line.
To follow this tutorial, you will need:
The first step is to install the Apache webserver on your POP! OS. Execute the following command in your terminal.
sudo apt-get update
sudo apt-get install apache2
Once Apache is installed, start the service and enable it to start automatically on system boot.
sudo systemctl start apache2
sudo systemctl enable apache2
sudo systemctl status apache2
Next, we need to install a database server to store our ownCloud data. Here, we will use MariaDB. Execute the following command in your terminal.
sudo apt-get install mariadb-server
Once MariaDB is installed, start the service and enable it to start automatically on system boot.
sudo systemctl start mariadb
sudo systemctl enable mariadb
sudo systemctl status mariadb
Before we install ownCloud, we need to create a database and user for it. Follow these instructions to create a new database in MariaDB.
sudo mysql -u root
CREATE DATABASE owncloud_db;
CREATE USER 'ownclouduser'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON owncloud_db.* TO 'ownclouduser'@'localhost';
FLUSH PRIVILEGES;
Make sure to replace the password
with a strong password for the ownCloud database user.
Now, we need to install PHP and some of its modules to run ownCloud. Execute the following command to install PHP and PHP modules.
sudo apt-get install php libapache2-mod-php php-mysql php-cli php-curl php-gd php-zip php-mbstring php-xml
Download the latest version of ownCloud from the official website. You can do it via the command line using the wget
command.
cd /tmp
wget https://download.owncloud.org/community/owncloud-latest.tar.bz2
Extract the downloaded archive by executing the following command.
sudo tar -xjf owncloud-latest.tar.bz2 -C /var/www/html/
Create a separate directory for ownCloud data by executing this command.
sudo mkdir -p /var/www/html/owncloud/data
Now, set the appropriate permissions for the ownCloud directory.
sudo chown -R www-data:www-data /var/www/html/owncloud/
sudo chmod -R 755 /var/www/html/owncloud/
To configure Apache, create a new VirtualHost configuration file for ownCloud by executing this command.
sudo nano /etc/apache2/sites-available/owncloud.conf
Add the following lines to the file.
<VirtualHost *:80>
ServerName owncloud.yourdomain.com
DocumentRoot /var/www/html/owncloud/
<Directory /var/www/html/owncloud/>
Options +FollowSymlinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Make sure to replace yourdomain.com
with your domain name or IP address.
Now, enable the new VirtualHost configuration file and restart the Apache service.
sudo a2ensite owncloud.conf
sudo systemctl restart apache2
If your system has SELinux enabled, you need to configure it to allow Apache to access ownCloud data and install additional PHP modules.
sudo chcon -t httpd_sys_rw_content_t /var/www/html/owncloud/data -R
sudo setsebool -P httpd_can_network_connect_db 1
sudo setsebool -P httpd_execmem 1
Now, you can finish the installation by visiting the ownCloud URL in your browser.
http://owncloud.yourdomain.com
Follow the on-screen instructions to complete the setup. Enter the database details for ownCloud during the installation.
Great! You have successfully installed ownCloud on POP! OS. You can now store, share, and access your data from anywhere.
If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!
Alternatively, for the best virtual desktop, try Shells!