1. Home
  2. Docker
  3. Run your own Omni Sync server with Docker, Apache and WebDAV

Run your own Omni Sync server with Docker, Apache and WebDAV

If you organize your life with OmniFocus or OmniOutliner (or anything else from The Omni Group), you can take control of your data by syncing to your own WebDAV server.

Docker makes it easy and we’ll be done in about 5 minutes! You’ll have Traefik (a reverse proxy) sorting out SSL certificates for you, and Watchtower running every night to update your containers.

Things you’ll need

Create a Cloud Server

  1. Login to the Bytemark Panel.
  2. Add a Cloud Server with these settings:
    • Name: Give your server a name (eg, “omnisync”)
    • Group: Leave as “default”
    • Resources: 1 Core, 1GiB Memory
    • Operating System: Debian 9
    • Discs: 25GiB SSD storage
    • Backup Schedule: Leave enabled (recommended)

Configure WebDAV over HTTPS

Install Docker

Login to your Debian 9 server via SSH and run these commands as root user:

apt-get update
apt-get install -y apt-transport-https ca-certificates curl gnupg2 software-properties-common
curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add -
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian `lsb_release -cs` stable"
apt-get update
apt-get install -y docker-ce
curl -fsSL https://github.com/docker/compose/releases/download/1.21.2/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
DEBIAN_FRONTEND=noninteractive apt-get install -y unattended-upgrades

Now you should have both docker-ce and docker-compose installed, and security upgrades will be applied automatically overnight.

Configure Docker Compose

Run these commands to retrieve some configuration files:

mkdir -p /root/compose
curl -fsSL https://raw.githubusercontent.com/BytemarkHosting/configs-webdav-docker/master/docker-compose.yml -o /root/compose/docker-compose.yml
curl -fsSL https://raw.githubusercontent.com/BytemarkHosting/configs-webdav-docker/master/.env -o /root/compose/.env
curl -fsSL https://raw.githubusercontent.com/BytemarkHosting/configs-webdav-docker/master/traefik.toml -o /root/compose/traefik.toml

The three configuration files you should have inside /root/compose are:

Create acme.json

Traefik is a reverse proxy that will handle all web traffic and automatically retrieve Let’s Encrypt SSL certificates. Traefik needs somewhere to store SSL certificates, so we’ll create a file that Docker Compose will bind mount into the container.

Run these commands as root:

touch /root/compose/acme.json
chmod 0600 /root/compose/acme.json

Configure your own domain

Docker Compose can use variables inside the Docker environment file (.env) to help configure your containers.

Open the Docker environment file in a text editor:

nano /root/compose/.env

Fill in WEBDAV_DOMAINS with your own domain. All domains you put here will need DNS records pointing to your server. For example, it might look like this:

WEBDAV_DOMAINS=ilovetestingthings.co.uk,www.ilovetestingthings.co.uk

Configure a WebDAV username and password

Run these commands to generate a user.passwd file (for Apache’s Basic authentication):

cd /root/compose
touch user.passwd
apt-get install -y apache2-utils
htpasswd -B user.passwd alice

You’ll be asked for a password. If you want to add more logins, you can just run the htpasswd command again with other usernames.

Start your containers

Run these commands as root:

cd /root/compose
docker-compose up -d

If you want to stop your containers, run this:

cd /root/compose
docker-compose down

If something isn’t quite working, you can check what containers are running and show their logs by running this:

docker ps -a
docker logs compose_traefik_1
docker logs compose_webdav_1

Sync your applications

Now that the server is up, let’s start syncing applications! The exact instructions depend on the application and platform. If unsure, consult the documentation from OmniGroup.

If you’re using OmniFocus 3 for iOS, follow these steps:

  1. Go to Settings.
  2. Select Sync Method.
  3. Select Custom (WebDAV).
  4. Fill the Address field with the full URL (eg, https://your_domain.com/webdav)
  5. Enter the username and password.

The username and password above is for connecting to your WebDAV server, but it’s a good idea to use a different password for encrypting your OmniFocus data. For OmniFocus 3 for iOS, follow these steps:

  1. Go to Settings.
  2. Select Encryption.
  3. Select Use Separate Passphrase.
  4. Enter current password.
  5. Enter new encryption password.
  6. Select Replace Server Database.
Updated on February 20, 2019

Was this article helpful?

Related Articles

Have you tried Kubernetes?
Kubernetes (K8s) is helping enterprises to ship faster & scale their business. Sounds good? Let us build a K8s solution for your needs.
Register your interest