I recently installed Ubuntu 18.04 LTS server on my lab computer and began testing installing OwnCloud… the steps below shows you how to I got OwnCloud installed on Ubuntu…
OwnCloud is a true open source, self-hosted cloud storage service. Like DropBox and other cloud storage services, OwnCloud provides similar functions and unlike the other proprietary storage services, OwnCloud is free to use…
OwnCloud enables private cloud services on users’ own servers. It’s a self-hosted file sync and share app platforms and with it you can access & sync your files, contacts and data across your devices.
This brief tutorial shows students and new users steps to install and configure OwnCloud on Ubuntu 18.04 LTS Servers in your own environment.
To get started with installing OwnCloud, follow the steps below:
Step 1: Install Apache2 HTTP Server
OwnCloud needs a web server… and the most popular webserver in use today is Apache2. So, go and install Apache2 on Ubuntu by running the commands below:
sudo apt install apache2
After installing Apache2, run the commands below to disable directory listing.
sudo sed -i "s/Options Indexes FollowSymLinks/Options FollowSymLinks/" /etc/apache2/apache2.conf
After install Apache2, the commands below can be used to stop, start and enable Apache2 service to always start up with the server boots.
sudo systemctl stop apache2.service sudo systemctl start apache2.service sudo systemctl enable apache2.service
Step 2: Install MariaDB Server
OwnCloud also needs a database server… and MariaDB database server is a great place to start. To install it run the commands below.
sudo apt-get install mariadb-server mariadb-client
After installing, the commands below can be used to stop, start and enable MariaDB service to always start up when the server boots.
sudo systemctl stop mariadb.service sudo systemctl start mariadb.service sudo systemctl enable mariadb.service
After that, run the commands below to secure MariaDB server.
sudo mysql_secure_installation
When prompted, answer the questions below by following the guide.
- Enter current password for root (enter for none): Just press the Enter
- Set root password? [Y/n]: Y
- New password: Enter password
- Re-enter new password: Repeat password
- Remove anonymous users? [Y/n]: Y
- Disallow root login remotely? [Y/n]: Y
- Remove test database and access to it? [Y/n]: Y
- Reload privilege tables now? [Y/n]: Y
Restart MariaDB server
sudo systemctl restart mariadb.service
Step 3: Install PHP and Related Modules
PHP 7.1 may not be available in Ubuntu default repositories… in order to install it, you will have to get it from third-party repositories.
Run the commands below to add the below third party repository to upgrade to PHP 7.1
sudo apt-get install software-properties-common sudo add-apt-repository ppa:ondrej/php
Then update and upgrade to PHP 7.1
sudo apt update
Finally, run the commands below to install PHP 7.1 and related modules..
sudo apt install php7.1 libapache2-mod-php7.1 php7.1-common php7.1-mbstring php7.1-xmlrpc php7.1-soap php7.1-apcu php7.1-smbclient php7.1-ldap php7.1-redis php7.1-gd php7.1-xml php7.1-intl php7.1-json php7.1-imagick php7.1-mysql php7.1-cli php7.1-mcrypt php7.1-ldap php7.1-zip php7.1-curl
After install PHP, run the commands below to open FPM PHP default file.
sudo nano /etc/php/7.1/apache2/php.ini
Then make the change the following lines below in the file and save.
file_uploads = On allow_url_fopen = On memory_limit = 256M upload_max_filesize = 100M display_errors = Off date.timezone = America/Chicago
Step 4: Create OwnCloud Database
Now that you’ve install all the packages that are required, continue below to start configuring the servers. First run the commands below to create a blank OwnCloud database.
To connect to MariaDB server, run the commands below.
sudo mysql -u root -p
Then create a database called owncloud
CREATE DATABASE owncloud;
Create a database user called ownclouduser with new password
CREATE USER 'ownclouduser'@'localhost' IDENTIFIED BY 'new_password_here';
Then grant the user full access to the database.
GRANT ALL ON owncloud.* TO 'ownclouduser'@'localhost' IDENTIFIED BY 'user_password_here' WITH GRANT OPTION;
Finally, save your changes and exit.
FLUSH PRIVILEGES; EXIT;
Step 5: Download OwnCloud Latest Release
Next, visit OwnCloud site to download your free copy. The community edition is what you’ll want to download.
Run the commands below to download using the command line terminal.. and extract OwnCloud files into its root directory..
cd /tmp && wget https://download.owncloud.org/community/owncloud-10.0.3.zip unzip owncloud-10.0.3.zip sudo mv owncloud /var/www/html/owncloud/
Then run the commands below to set the correct permissions for OwnCloud to function.
sudo chown -R www-data:www-data /var/www/html/owncloud/ sudo chmod -R 755 /var/www/html/owncloud/
Step 6: Configure Apache2
Finally, configure Apahce2 site configuration file for OwnCloud. This file will control how users access OwnCloud content. Run the commands below to create a new configuration file called owncloud.conf
sudo nano /etc/apache2/sites-available/owncloud.conf
Then copy and paste the content below into the file and save it. Replace the highlighted line with your own domain name and directory root location.
<VirtualHost *:80> ServerAdmin admin@example.com DocumentRoot /var/www/html/owncloud/ ServerName example.com ServerAlias www.example.com Alias /owncloud "/var/www/html/owncloud/" <Directory /var/www/html/owncloud/> Options +FollowSymlinks AllowOverride All Require all granted <IfModule mod_dav.c> Dav off </IfModule> SetEnv HOME /var/www/html/owncloud SetEnv HTTP_HOME /var/www/html/owncloud </Directory> ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost>
Save the file and exit.
Step 7: Enable the OwnCloud and Rewrite Module
After configuring the VirtualHost above, enable it by running the commands below
sudo a2ensite owncloud.conf sudo a2enmod rewrite sudo a2enmod headers sudo a2enmod env sudo a2enmod dir sudo a2enmod mime
Step 8 : Restart Apache2
To load all the settings above, restart Apache2 by running the commands below.
sudo systemctl restart apache2.service
Then open your browser and browse to the server domain name followed by install. You should see OwnCloud setup wizard to complete. Please follow the wizard carefully.
http://example.com
You should then see OwnCloud setup page.. Connect to the database using the information you created and continue. Select the database server installed on your systems by clicking it as shown in the image below
Click Finish setup and you’re done.
Enjoy!
Congratulations! You have successfully installed OwnCloud on Ubuntu 18.04 LTS Server
You may also like the post below:
Install PrestaShop on Ubuntu 17.04 / 17.10 with Apache2, MariaDB and PHP
Thank you for sharing this. I have been trying to get owncloud setup on a VirtualMachine and I have had nothing but issues. I wish there was a way to change the location of the data that users upload, like onto a shared drive/folder on another Harddrive.
Thanks again!
Thanks a lot for your time, you help many of us by making How-Tos. Really aprreciated! With all the eavesdropping things happening on the web, I’m glad to see that we have an alternate solution to the Big Guys, accessible by anyone who wishes to spend a bit of time 😉
tengo el siguiente problema:
root@owncloud-ProLiant-ML110-G3:~# sudo apt install php7.1 libapache2-mod-php7.1 php7.1-common php7.1-mbstring php7.1-xmlrpc php7.1-soap php7.1-apcu php7.1-smbclient php7.1-ldap php7.1-redis php7.1-gd php7.1-xml php7.1-intl php7.1-json php7.1-imagick php7.1-mysql php7.1-cli php7.1-mcrypt php7.1-ldap php7.1-zip php7.1-curl
Leyendo lista de paquetes… Hecho
Creando árbol de dependencias
Leyendo la información de estado… Hecho
Nota, seleccionando «php7.1-mapi» para la expresión regular «php7.1»
E: No se ha podido localizar el paquete libapache2-mod-php7.1
E: No se pudo encontrar ningún paquete usando «*» con «libapache2-mod-php7.1»
E: No se pudo encontrar ningún paquete con la expresión regular «libapache2-mod-php7.1»
E: No se ha podido localizar el paquete php7.1-common
E: No se pudo encontrar ningún paquete usando «*» con «php7.1-common»
E: No se pudo encontrar ningún paquete con la expresión regular «php7.1-common»
E: No se ha podido localizar el paquete php7.1-mbstring
E: No se pudo encontrar ningún paquete usando «*» con «php7.1-mbstring»
E: No se pudo encontrar ningún paquete con la expresión regular «php7.1-mbstring»
E: No se ha podido localizar el paquete php7.1-xmlrpc
E: No se pudo encontrar ningún paquete usando «*» con «php7.1-xmlrpc»
E: No se pudo encontrar ningún paquete con la expresión regular «php7.1-xmlrpc»
E: No se ha podido localizar el paquete php7.1-soap
E: No se pudo encontrar ningún paquete usando «*» con «php7.1-soap»
E: No se pudo encontrar ningún paquete con la expresión regular «php7.1-soap»
E: No se ha podido localizar el paquete php7.1-apcu
E: No se pudo encontrar ningún paquete usando «*» con «php7.1-apcu»
E: No se pudo encontrar ningún paquete con la expresión regular «php7.1-apcu»
E: No se ha podido localizar el paquete php7.1-smbclient
E: No se pudo encontrar ningún paquete usando «*» con «php7.1-smbclient»
E: No se pudo encontrar ningún paquete con la expresión regular «php7.1-smbclient»
E: No se ha podido localizar el paquete php7.1-ldap
E: No se pudo encontrar ningún paquete usando «*» con «php7.1-ldap»
E: No se pudo encontrar ningún paquete con la expresión regular «php7.1-ldap»
E: No se ha podido localizar el paquete php7.1-redis
E: No se pudo encontrar ningún paquete usando «*» con «php7.1-redis»
E: No se pudo encontrar ningún paquete con la expresión regular «php7.1-redis»
E: No se ha podido localizar el paquete php7.1-gd
E: No se pudo encontrar ningún paquete usando «*» con «php7.1-gd»
E: No se pudo encontrar ningún paquete con la expresión regular «php7.1-gd»
E: No se ha podido localizar el paquete php7.1-xml
E: No se pudo encontrar ningún paquete usando «*» con «php7.1-xml»
E: No se pudo encontrar ningún paquete con la expresión regular «php7.1-xml»
E: No se ha podido localizar el paquete php7.1-intl
E: No se pudo encontrar ningún paquete usando «*» con «php7.1-intl»
E: No se pudo encontrar ningún paquete con la expresión regular «php7.1-intl»
E: No se ha podido localizar el paquete php7.1-json
E: No se pudo encontrar ningún paquete usando «*» con «php7.1-json»
E: No se pudo encontrar ningún paquete con la expresión regular «php7.1-json»
E: No se ha podido localizar el paquete php7.1-imagick
E: No se pudo encontrar ningún paquete usando «*» con «php7.1-imagick»
E: No se pudo encontrar ningún paquete con la expresión regular «php7.1-imagick»
E: No se ha podido localizar el paquete php7.1-mysql
E: No se pudo encontrar ningún paquete usando «*» con «php7.1-mysql»
E: No se pudo encontrar ningún paquete con la expresión regular «php7.1-mysql»
E: No se ha podido localizar el paquete php7.1-cli
E: No se pudo encontrar ningún paquete usando «*» con «php7.1-cli»
E: No se pudo encontrar ningún paquete con la expresión regular «php7.1-cli»
E: No se ha podido localizar el paquete php7.1-mcrypt
E: No se pudo encontrar ningún paquete usando «*» con «php7.1-mcrypt»
E: No se pudo encontrar ningún paquete con la expresión regular «php7.1-mcrypt»
E: No se ha podido localizar el paquete php7.1-ldap
E: No se pudo encontrar ningún paquete usando «*» con «php7.1-ldap»
E: No se pudo encontrar ningún paquete con la expresión regular «php7.1-ldap»
E: No se ha podido localizar el paquete php7.1-zip
E: No se pudo encontrar ningún paquete usando «*» con «php7.1-zip»
E: No se pudo encontrar ningún paquete con la expresión regular «php7.1-zip»
E: No se ha podido localizar el paquete php7.1-curl
E: No se pudo encontrar ningún paquete usando «*» con «php7.1-curl»
E: No se pudo encontrar ningún paquete con la expresión regular «php7.1-curl»
podrian ayudarme al parcer no encuentro el repositorio o la ubucacion de los archivos, de antemano Gracias
Yo los instalé uno por uno quitando el “7.1”, ejemplo: php-curl. El único que no encontró fue el mcrypt.
After following instructions on this site for Ubuntu 18.04 + OwnCloud 10.0.8, I was UNABLE to change owncloud as the default/root site such as cloud.example.com. Appending ‘/owncloud’ to the url still works, however (although I don’t know why):
The key changes, from what I can tell, are:
/var/www/html/owncloud/config/config.php
—>’overwrite.cli.url’ => ‘http://cloud.example.com’,
/etc/apache2/sites-available/owncloud.conf
—>Alias / “/var/www/html/owncloud/”
of course republish owncloud.conf and restart apache.
I got it to work by making one last change in config.php. In the trusted_domains array field, I placed the domain cloud.example.com as the FIRST element in the array, before the local IP specifier. This would appear to be a failing in the Owncloud bits, but is a good work around for the next guy. HTH.
thanks. its work for me
Gracias por su documentation muy buena. He podido installar sin ningun problema.
Great guide, one thing to note, that in 18.04.1 it wont find mariadb when you try to do the install. To fix it you need to run the following commands and then you will be golden:
$ sudo cp /etc/apt/sources.list /etc/apt/sources.list.orig
$ sudo sed -i ‘s/bionic main/bionic main universe/g’ /etc/apt/sources.list
$ sudo apt-get update