Detailed Installation Guide

Introduction

This document describes:

  • How to prepare your server

  • Prerequisites and how to download ownCloud

  • Installation of ownCloud

The following descriptions focus on the Ubuntu distribution. Even if we try to make these steps as easy as possible by offering ready to use commands and scripts, you need to have sufficient knowledge about administrating a server environment which provides web services.

This document does not offer proposals about how to secure your server. Therefore, we strongly recommend checking out the Hardening and Security Guidance before the installation and to keep it on hand throughout.

Prepare Your Server

For more information on the requirements of your server, read the general prerequisites guide. The following sections describe the procedures in detail.

Ubuntu 20.04 LTS Server

To prepare your Ubuntu 20.04 server for the use with ownCloud, follow the Ubuntu 20.04 preparation guide. This guide installs PHP 7.4

Ubuntu 22.04 LTS Server

To prepare your Ubuntu 22.04 server for the use with ownCloud, follow the Ubuntu 22.04 preparation guide.

Ubuntu 22.04 only provides PHP 8.x which is currently not supported by ownCloud. Therefore PHP 7.4 is installed via PPA.

Install a Database

If you do not already have a supported database installed, follow the Manual Database Installation guide.

Configure the Web Server

To configure your Apache web server for use with ownCloud, follow the Apache preparation guide.

Installation of ownCloud Binaries

To install ownCloud binaries, you have to download the required package. After doing so, you can perform the following steps manually or use the provided scripts. These scripts are convenient since they can also be used for upgrading which eases the process a lot.

Download ownCloud

Before downloading ownCloud, change to a directory where you want to save the file temporarily. This can be, for example /tmp. In further examples, we use tar archives or the complete ownCloud bundle. The name for the complete archive looks like this: owncloud-complete-yyyymmdd.archive_type.

Download the archive of the latest ownCloud version:

  1. Go to the ownCloud Download Page and select the package that fits your needs. You can download either the .tar.bz2 or .zip archive. Based on the example below, copy the link of the selected file and run the following command to download it:

    wget https://download.owncloud.com/server/stable/owncloud-complete-latest.tar.bz2
  2. Download the corresponding checksum file like:

    wget https://download.owncloud.com/server/stable/owncloud-complete-latest.tar.bz2.md5
      or
    wget https://download.owncloud.com/server/stable/owncloud-complete-latest.tar.bz2.sha256
  3. Verify the MD5 or SHA256 sum:

    sudo md5sum -c owncloud-complete-latest.tar.bz2.md5 < owncloud-complete-latest.tar.bz2
     or
    sudo sha256sum -c owncloud-complete-latesttar.bz2.sha256 < owncloud-complete-latest.tar.bz2
  4. You can also verify the PGP signature:

    wget https://download.owncloud.com/server/stable/owncloud-complete-latest.tar.bz2.asc
    
    gpg --verify owncloud-complete-latest.tar.bz2.asc owncloud-complete-latest.tar.bz2

Script-Guided Installation

Use the Script-Guided Installation if you want to easily install or upgrade ownCloud or manage ownership and permissions. The page contains detailed instructions about downloading and usage.

Using the Script Guided Installation, you can handle many useful installation and update options automatically.

Command Line Installation

Use the following commands if you want to do the basic setup without any changes and physical installation options. Consider using the Script-Guided Installation if you plan to improve your setup from step one.

  • Extract the archive contents and run the unpacking command for your tar archive:

    tar -xjf owncloud-complete-latest.tar.bz2
  • tar unpacks to a single owncloud directory. Copy the ownCloud directory to its final destination. If you are running the Apache HTTP server, you may safely install ownCloud in your Apache document root. Assuming your document root is in /var/www.

    cp -r owncloud /var/www

After the installation, set the correct ownership and permissions according to the needs of your environment. While you can do that manually, we suggest using the scripts from the Script-Guided Installation which ease the process a lot.

Complete the Installation

After restarting Apache, you must complete your installation by running either the Graphical Installation Wizard or on the command line with the occ command.

After finalizing the installation, re-run the script provided in Script-Guided Installation to secure your .htaccess files. Your ownCloud instance is now ready to use.

Finalize Using the Graphical Installation Wizard

To finalize the installation using the graphical installation wizard, refer to the Graphical Installation Wizard.

Finalize Using the Command Line

If you want to finalize the installation via the command line, use the following example command. The command assumes that you have unpacked the source to /var/www/owncloud/. Replace all the parameters according to your needs.

cd /var/www/owncloud/
sudo -u www-data ./occ maintenance:install \
   --database "mysql" \
   --database-name "owncloud" \
   --database-user "root"\
   --database-pass "password" \
   --admin-user "admin" \
   --admin-pass "password"

On how to use occ, refer to the occ command reference.

Admins of SELinux-enabled distributions may need to write new SELinux rules to complete their ownCloud installation; see the SELinux Configuration Guide for a suggested configuration.

Post Installation Configuration

After installing ownCloud successfully, ownCloud recommends that you perform some post installation tasks. These tasks help configure background jobs or improve performance by caching.

At this point, we’d also like to remind you to consult the Hardening and Security Guidance section.

Background Jobs

To read more about background jobs and how to configure them, read the Background Job Configuration guide.

Configure Caching

It is recommended to install and enable caching (PHP opcode cache and/or data cache), which significantly improves performance. For more information, read the Caching Configuration guide.

Notes

Headers

ownCloud has a mechanism to set headers programmatically. These headers are set with the always directive to avoid errors when there are additional headers set in the web server’s configuration file like http.conf. More information on headers can be found in the mod_headers documentation.

Managing Trusted Domains

All URLs used to access your ownCloud server must be white-listed in your config.php file under the trusted_domains setting. Users are allowed to log in to ownCloud only when they point their browsers to a URL that is listed in the trusted_domains setting.

This setting is important when changing or moving to a new domain name. You may use IP addresses and domain names.

A typical configuration may look like this:

'trusted_domains' => [
   0 => 'localhost',
   1 => 'server1.example.com',
   2 => '192.168.1.50',
],

The loopback address, 127.0.0.1, is automatically white-listed, so as long as you have access to the physical server you can always log in. In the event that a load-balancer is in place, there will be no issues as long as it sends the correct X-Forwarded-Host header.

For further information on improving the quality of your ownCloud installation, see the configuration notes and tips guide.
Admins of SELinux-enabled distributions such as CentOS, Fedora, and Red Hat Enterprise Linux may need to set new rules to enable installing ownCloud. See SELinux Configuration Guide for a suggested configuration.