OwnCloud was one of the original on-premise cloud solutions and is still going strong today. This cloud/collaboration platform can be easily deployed to your in-house data center or a third-party cloud host and can serve several use cases. It can be used for cloud storage, team collaboration, file sharing, calendaring, and even a full-blown, cloud-based office suite.
SEE: Hiring Kit: Cloud Engineer (TechRepublic Premium)
The ownCloud feature set includes:
- Data sync
- Data sharing
- Versioning
- Encryption
- Drag and drop upload
- Theming
- Groups
- Activity Stream
- Android, iOS, and desktop apps
- Office 365 integration
- Guest users
Before you think ownCloud is a challenge to install, let me put those fears to rest by walking you through a deployment on Ubuntu Server 20.04.
What you’ll need
To successfully deploy ownCloud, you’ll need a running instance of Ubuntu Server 20.04 and a user with sudo privileges. That’s it. Let’s make this happen.
How to install the LAMP stack
The first thing we must do is install the LAMP stack. Log into your Ubuntu Server instance and issue the command:
sudo apt-get install lamp-server^ -y
Once the LAMP server is installed, make sure to start and enable the Apache and MySQL servers with the following commands:
sudo systemctl enable --now apache2
sudo systemctl enable --now mysql
Next, we need to secure the MySQL installation with the command:
sudo mysql_secure_installation
You’ll be asked if you want to enable the VALIDATE PASSWORD COMPONENT. By enabling this feature, you require all passwords to be of a certain strength. You can bypass this by typing n. If you do opt to not enable the feature, you should still make sure to use very strong passwords for your MySQL admin user (and all MySQL users).
Finally, answer y to the remaining questions to secure the MySQL database.
How to create the ownCloud database
Next, we’ll create the necessary database and a user for the database. Log in to the MySQL console with:
sudo mysql -u root -p
Once in the console, create the database with:
CREATE DATABASE ownclouddb;
Create the new ownCloud database user with:
CREATE USER 'ownclouduser'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
Grant the necessary privileges for the new database user with:
GRANT ALL PRIVILEGES ON ownclouddb.* TO 'ownclouduser'@'localhost';
Flush the privileges and exit from the MySQL console with:
FLUSH PRIVILEGES;
exit
How to install PHP
OwnCloud heavily depends on PHP, so we’ll need to install it and a number of modules with the command:
sudo apt-get install php php-opcache php-gd php-curl php-mysqlnd php-intl php-json php-ldap php-mbstring php-mysqlnd php-xml php-zip -y
Once the installation completes, restart Apache with:
sudo systemctl restart apache2
How to download and unpack ownCloud
We’ll now download the latest version of ownCloud with the command:
wget https://download.owncloud.com/server/stable/owncloud-complete-latest.zip
Unzip the file with:
unzip owncloud-complete-latest.zip
If the unzip command isn’t found, install it with:
sudo apt-get install unzip -y
Move the newly created directory with:
sudo mv owncloud /var/www/html
Change the ownership of the directory with the command:
sudo chown -R www-data: /var/www/html/owncloud
How to create an Apache configuration file
We’ll now create an Apache configuration file for ownCloud. Create the new file with the command:
sudo nano /etc/apache2/sites-available/owncloud.conf
In that file, paste the following (make sure to add your own admin email address and ServerName):
   <VirtualHost *:80>
   ServerAdmin admin@your_domain.com
   DocumentRoot /var/www/html/owncloud
   ServerName your-domain.com
<><Directory /var/www/html/owncloud>
   Options FollowSymlinks
   AllowOverride All
   Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/your-domain.com_error.log
CustomLog ${APACHE_LOG_DIR}/your-domain.com_access.log combined
</VirtualHost>
Restart Apache with:
sudo systemctl restart apache2
How to complete the installation
Open a web browser and point it to http://SERVER/owncloud (Where SERVER is the IP address or domain of your server). In the resulting window (Figure A), fill out the information for a new admin account and then add the details for the database server.
Figure A
For the database, fill in the following:
- Database user–ownclouduser
- Database password–the password you set for the owncloud user
- Database–ownclouddb
- Localhost–localhost
After filling in all the necessary details, click Finish setup and, in less than a minute, the installation will complete and you can then log in as the admin user.
Congratulations, you now have a working ownCloud instance to use as your on-premise cloud server. If you’ve ever used Nextcloud, you notice some similarities, but even more differences. For example, out of the box, ownCloud doesn’t include nearly as many pre-installed apps as does Nextcloud. To round out your deployment, you’ll want to immediately head to the Market and start installing additional applications.
Subscribe to TechRepublic’s How To Make Tech Work on YouTube for all the latest tech advice for business pros from Jack Wallen.