ownCloud is an open-source, self-hosted cloud service that can be installed on a local or remote server. For better performance and reliability it’s best to host it on a commercial hosting service. Both dedicated and shared web hosting packages will work assuming the service is reasonably feature rich. If reliability is not an issue it can be hosted on a local home server without issues as well.
It is recommended to use a dedicated domain as opposed to a path on an existing domain / website.This is the preferred method as it offers all the benefits of the Same-Origin-Policy. Log into cPanel and create a sub-domain. Doing this will automatically create a directory within the web root.
For a simpler but less secure setup, connect to the server with an ftp client or file manager in cPanel and create a sub-directory in the web root. Download the setup file and upload it to the previously created directory with an ftp client or file manager in cPanel. Alternatively setup SSH on the shared (or dedicated) hosting server before proceeding.
Secure HTTP should ideally be used how ever private SSL certificates are somewhat impractical for personal use. Shared SSL certificates are often provided by web hosts but web browsers will show certificate errors which is inconvenient and unreliable if files are to be shared with other users or the general public. The choice whether to use SSL or not comes down to use case and the balance between simplicity, convenience and security.
Connect to the web server with SSH.
ssh firstname.lastname@example.org -p 22
Default port of
22 is used but any port value can be specified with the
Create a sub-directory if not using a sub-domain.
Change current directory to the previously created sub-domain directory.
Download the PHP installer file.
Navigate to the php file in a browser for example localhost/owncloud/setup-owncloud.php
Follow on screen instructions making sure to enter the correct sub-domain directory which is defined as a
. for the current directory. The installation can take a little while during which no UI elements should be interacted with to avoid a failed installation.
Enter a new admin
password. For security reasons it’s best to define the data directory outside of the web root. For example
~/owncloud-data instead of
~/public_html/owncloud/data. Default database is SQLite which very simple to setup and manage but is not recommended as it doesn’t handle multi user scenarios well. Create a new MariaDB, MySQL or postgreSQL database in cPanel along with a database user and add the user to the database. Enter the database details and the database tables will be created before the setup is complete.
To improve security ownCloud should have access to
/dev/urandom. Explicitly defining access may be required depending on the configuration of the server. Test PHP configuration to verify if this is required.
Create a new php file in the document root.
Add the phpinfo function and save the file.
<?php phpinfo(); ?>
Open the page in a web browser. For example localhost/phpinfo.php
If PHP version and other information is loaded then PHP is working otherwise it will just print the plain text contained in the file. Search for
open_basedir option. If disabled,
no value will be printed and the subsequent section on allowing access with
open_basedir directive is not needed.
Append a directive to the web configuration file.
echo 'SuPHP_ConfigPath ~/public_html/owncloud' >> ~/public_html/owncloud/.htaccess
~ with the actual home directory path such as
/home/username. This will make php.ini configuration file apply recursively to all sub directories.
Append the directive to the PHP configuration file.
echo 'open_basedir = "/var/urandom/"' >> ~/public_html/owncloud/php.ini
Set the permissions on the configuration file.
chmod 640 php.ini
ownCloud has it’s own .htaccess file with relevant configurations already present. These configurations include maximum upload size which is set to
1 GB by default but can be changed from the web interface or directly by editing the file.
Access via the web interface at the sub-domain or sub-path. Data can also be synced via the free desktop apps available for Linux, Windows and Mac. Mobile apps are also available for Android, iOS and Blackberry. On Arch Linux the desktop client can be installed from the official repository.