Hosting your own private Cloud-Storage Server isn’t that hard. This Tutorial is about installing an ownCloud Server on OS X 10.11 EL Capitan as Dropbox- / Onedrive- / Googledrive- Alternative.

ownCloud OS XServer

ownCloud made a massive development from the Beginning to the current Version. It has Sync-Clients for all major Operating Systems and Apps for Mobile Clients. iOS Users get the Integration / Access to Files into the System like Accessing / Up- and Downloading Pictures and Videos and to files with Apps like Office 365 etc.

While OS X already has all the Components needed, this Article is about installing a seperate Instance of the required Components (Apache, MySQL, PHP).


ownCloud is not official supported on OS X because of Issue #2377 german “Umlaut” / UTF-8 Problems, but these Problems are not reproduceable for me with this Installation – so i think it’s worth to try. Anyway – use this “as always” at your own risk, make backups of your data and do sufficient tests before using it for productive environments.



“Brew” Package Manager

First you’ll need to install “brew”. Brew is a Package Manager for OS X – if you don’t already have it, install it by firing up a Terminal (Applications>Utilities>Terminal) and entering:

ruby -e "$(curl -fsSL"

Check if brew is ready:

brew doctor

You should also check if brew is up-to-date:

brew update

Update brew and installed packages with:

brew upgrade



MySQL is our Database-Server which will host our ownCloud Database later. Brew it with:

brew install mysql


We need to add other repos (called “taps” in brew), to get a more updated version of Apache:

brew tap homebrew/dupes
brew tap homebrew/apache

Now let’s install apache:

brew install -v httpd22 --with-brewed-openssl


PHP is a sripting Language – It’s essential to get ownCloud working:

Add the repository first:

brew tap homebrew/php

I got a lot of Problems with “FPM”. In most cases it / resp. PHP was crashing on heavy load while syncing a lot of files, so i decide to install PHP without FPM:

brew install -v php55 --homebrew-apxs --with-apache --without-fpm

I got also Problems with the Pear-Lib and with some Permissions after trying to install additional packages – So this is the command how i it’s fixed (thanks to Alan Iveys Blog Entry here):

touch $(brew --prefix php55)/lib/php/.lock && chmod 0644 $(brew --prefix php55)/lib/php/.lock

Install some additional PHP Modules which will be needed for ownCloud later:

brew install -v php55-opcache
brew install php55-apcu
brew install mcrypt
brew install php55-mcrypt --without-homebrew-php
brew install php55-intl --without-homebrew-php


We will install a SSL Certificate directly – So all connections between the ownCloud Server and Client will be encrypted. If you don’t have an SSL Certificate, you can create your own:

openssl genrsa -des3 -passout pass:x -out server.pass.key 2048
openssl rsa -passin pass:x -in server.pass.key -out server.key
openssl req -new -key server.key -out server.csr

Keep the Password Prompt empty and just hit enter. You can raise the “-days” parameter to keep your certificate longer valid:

openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt

Create a new directory for your Certificate and Keyfile:

mkdir /usr/local/etc/apache/2.2/ssl

Copy your Key and Certificate to the destination:

cp server.crt /usr/local/etc/apache/2.2/ssl/server.crt
cp server.key /usr/local/etc/apache/2.2/ssl/server.key




Edit Apaches SSL-Configuration File:

nano -w /usr/local/etc/apache/2.2/extra/httpd-ssl.conf

And check if the red marked Parameters point to your .crt and .key file and are uncommented:

# Server Certificate:
# Point SSLCertificateFile at a PEM encoded certificate. If
# the certificate is encrypted, then you will be prompted for a
# pass phrase. Note that a kill -HUP will prompt again. Keep
# in mind that if you have both an RSA and a DSA certificate you
# can configure both in parallel (to also allow the use of DSA
# ciphers, etc.)
# Some ECC cipher suites (
# require an ECC certificate which can also be configured in
# parallel.
SSLCertificateFile "/usr/local/etc/apache2/2.2/ssl/server.crt"
#SSLCertificateFile "/usr/local/etc/apache2/2.2/server-dsa.crt"
#SSLCertificateFile "/usr/local/etc/apache2/2.2/server-ecc.crt"
# Server Private Key:
# If the key is not combined with the certificate, use this
# directive to point at the key file. Keep in mind that if
# you've both a RSA and a DSA private key you can configure
# both in parallel (to also allow the use of DSA ciphers, etc.)
# ECC keys, when in use, can also be configured in parallel
SSLCertificateKeyFile "/usr/local/etc/apache2/2.2/ssl/server.key"
#SSLCertificateKeyFile "/usr/local/etc/apache2/2.2/server-dsa.key"
#SSLCertificateKeyFile "/usr/local/etc/apache2/2.2/server-ecc.key"



Edit PHPs Config-File

nano -w /usr/local/etc/php/5.5/php.ini

And look for the following parameters. Set the Parameters to your needs – the Explanation of each Parameter can be found next to the Parameter. This are my settings:

upload_max_filesize = 250M
max_file_uploads = 50
default_charset = "UTF-8"
post_max_size = 0
default_socket_timeout = 3000
mysql.connect_timeout = 120
error_log = /usr/local/var/log/php-error.log



While we are creating a config from scratch, move/rename the old to a config backup file.

mv /usr/local/etc/apache2/2.2/httpd.conf /usr/local/etc/apache2/2.2/httpd.old 

Now edit the Main- Config-File:

nano -w /usr/local/etc/apache2/2.2/httpd.conf

Add the following Configuration to your empty Config-File. Change the red marked Parameters to your needs:

ServerRoot "/usr/local/opt/httpd22"

ServerName localhost
Listen 8080

User daemon
Group daemon


LoadModule authn_file_module libexec/
LoadModule authn_dbm_module libexec/
LoadModule authn_anon_module libexec/
LoadModule authn_dbd_module libexec/
LoadModule authn_default_module libexec/
LoadModule authz_host_module libexec/
LoadModule authz_groupfile_module libexec/
LoadModule authz_user_module libexec/
LoadModule authz_dbm_module libexec/
LoadModule authz_owner_module libexec/
LoadModule authz_default_module libexec/
LoadModule auth_basic_module libexec/
LoadModule auth_digest_module libexec/
LoadModule cache_module libexec/
LoadModule dbd_module libexec/
LoadModule dumpio_module libexec/
LoadModule reqtimeout_module libexec/
LoadModule ext_filter_module libexec/
LoadModule include_module libexec/
LoadModule filter_module libexec/
LoadModule substitute_module libexec/
LoadModule deflate_module libexec/
LoadModule log_config_module libexec/
LoadModule log_forensic_module libexec/
LoadModule logio_module libexec/
LoadModule env_module libexec/
LoadModule mime_magic_module libexec/
LoadModule cern_meta_module libexec/
LoadModule expires_module libexec/
LoadModule headers_module libexec/
LoadModule ident_module libexec/
LoadModule usertrack_module libexec/
LoadModule unique_id_module libexec/
LoadModule setenvif_module libexec/
LoadModule version_module libexec/
LoadModule proxy_module libexec/
LoadModule proxy_connect_module libexec/
LoadModule proxy_ftp_module libexec/
LoadModule proxy_http_module libexec/
LoadModule proxy_scgi_module libexec/
LoadModule proxy_ajp_module libexec/
LoadModule proxy_balancer_module libexec/
LoadModule ssl_module libexec/
LoadModule mime_module libexec/
LoadModule dav_module libexec/
LoadModule status_module libexec/
LoadModule autoindex_module libexec/
LoadModule asis_module libexec/
LoadModule info_module libexec/
LoadModule suexec_module libexec/
LoadModule cgi_module libexec/
LoadModule cgid_module libexec/
LoadModule dav_fs_module libexec/
# LoadModule vhost_alias_module libexec/
LoadModule negotiation_module libexec/
LoadModule dir_module libexec/
LoadModule imagemap_module libexec/
LoadModule actions_module libexec/
LoadModule speling_module libexec/
LoadModule userdir_module libexec/
LoadModule alias_module libexec/
LoadModule rewrite_module libexec/
LoadModule php5_module /usr/local/Cellar/php55/5.5.30/libexec/apache2/

SSLEngine on
SSLCertificateFile /usr/local/etc/apache2/2.2/ssl/server.crt
SSLCertificateKeyFile /usr/local/etc/apache2/2.2/ssl/server.key

DocumentRoot "/usr/local/var/www/htdocs"

<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all

<Directory "/usr/local/var/www/htdocs">
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all

ErrorLog "/usr/local/var/log/apache2/error_log"
LogFormat "%h %l %u %t \"%r\" %>s %b" common
CustomLog "/usr/local/var/log/apache2/access_log" common

AddHandler php5-script .php
AddType text/html .php
DirectoryIndex index.php index.html

<IfModule mod_headers.c>
Header always set Strict-Transport-Security "max-age=15768000; includeSubDomains; preload"
<IfModule mod_headers.c>

Service Setup


Make sure the Folder “LaunchAgents” exists in your Users Library Folder before you continue (Thanks to Daniel Neuwirth for this Hint):

ls -l ~/Library/ | grep LaunchAgents

This should output something like “drwxr-xr-x   10 user  staff   340  4 Mar 19:28 LaunchAgents“. If there is no output you’ll need to create the Folder first:

mkdir ~/Library/LaunchAgents


The next command will let PHP Autostart at Login:

ln -sfv /usr/local/opt/php55/*.plist ~/Library/LaunchAgents

Afterwards this command will start PHP now:

launchctl load ~/Library/LaunchAgents/homebrew.mxcl.php55.plist


This command will let Apache Autostart at Login:

ln -sfv /usr/local/opt/httpd22/*.plist ~/Library/LaunchAgents

Let’s launch Apache now:

launchctl load ~/Library/LaunchAgents/homebrew.mxcl.httpd22.plist


Adding MySQL to Autostart:

ln -sfv /usr/local/opt/mysql/*.plist ~/Library/LaunchAgents

Launch mysql now:

launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist


Finalizing / Testing

MySQL Password

Set a password for mysql. The default Password after the Installation is empty, so just hit return if asked and enter your new password afterwards.

mysqladmin -u root -p password

Testing MySQL

Try to login to mysql with your new password:

mysql -u root -p

If everything goes alright exit it by entering “quit”.

Testing Apache

Open a Webbrowser and enter the URL: https://localhost:8080 – You’ll be prompted to Accept your self-signed Certificate. Accept this and you should see the Apache Test-Page.

Testing PHP

Create a new file called phpinfo.php:

nano -w /usr/local/var/www/phpinfo.php

Add the following Code to the file:


Save and quit the file. Open the new created file in your browser now: https://localhost:8080/phpinfo.php – You should see now an Information-Page about your PHP-Configuration and it’s environment.

(Optional) Reboot Test

Sounds strange but sometimes things go wrong after a reboot – so no fear – reboot your system if possible and check if still all services are OK.


Intermediate result

You have now a complete MAMP Environment and we are ready to install ownCloud now. Continue with Part 2, to get the ownCloud installation done. Please have a look at the Troubleshooting point if you got problems with the Testings before – If a service is faulty you should try to get it fixed before you continue.

ownCloud Server Installation

We need to create a database first.

mysql -u root -p

CREATE USER 'owncloud'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON owncloud.* TO 'owncloud'@'localhost' IDENTIFIED BY 'password';


Go to and download. In my Case i downloaded owncloud 8.1.3. The extracted package should give you a folder “own cloud”. Move the folder to your web servers root directory.

mkdir /usr/local/var/www/htdocs/apps

mv owncloud/ /usr/local/var/www/htdocs/apps/

Fire up the browser on the Server now with “https://localhost:8080/apps/owncloud”. Enter a Username and Password you like and change the Database Configuration to “MySQL / MariaDB”. Enter the Database user “owncloud” with the chosen password. You’ll be logged on to ownlCloud afterwards automatically.

Database Config

Edit the Configuration File after the Setup is done:

nano -w /usr/local/var/www/htdocs/apps/owncloud/config/config.php

Add the following line to the End of the Configuration-File to enable Caching:

memcache.local' => '\OC\Memcache\APCu',


ownCloud Client Config

You can now install the ownCloud Client on your Machine to sync files. If you receive an Error-Message here – check if you Hostname is added to the Config-File (see Troubleshooting-Part > ownCloud at the End of this Tutorial).

ownCloud Client Setup



Apache / Webservices

Check if apache is running:

Try to open it via a browser (https://localhost:port;

Check if the Service is running

ps ax | grep apache

Check if your Apache-Config has syntax errors:

apachectl -t

You can read the Apache Logs, especially the Error_Log with the following command:

cat /usr/local/var/log/apache2/error_log

The Access_Log will help you to find errors while opening Webpages:

cat /usr/local/var/log/apache2/access_log


You can read the PHP-Error log with the following command:

cat /usr/local/var/log/php-error.log

Also have a look at the before created phpinfophp to check if necessary Modules are loaded etc. (Browser: https://localhost/phpinfo.php).



If you receive the message that you are accessing the server from an untrusted domain, you can fix it by adding your hostname (DynDNS, IP-Addresses) to the ownCloud Config-File.

ownCloud Trusted Webpage Error

Edit the Config-File with:

nano -w /usr/local/var/www/htdocs/apps/owncloud/config/config.php

Add new Hostnames / IPs: Look for the “trusted_domains” segment and add +1 line to the array – don’t foget to close the line with “,” – See example:

'trusted_domains' =>
array (
0 => 'localhost:8080',
1 => '',
2 => '',



Recent Articles...