We have already written about Owncloud and a traditional method to install it on a Linux Ubuntu instance This guide will show how to get a quickly running instance by leveraging Docker.

Start your Owncloud powered by Docker

  1. Log on to Exoscale Portal
  2. Go to the ADD instance 1 page wizard
  3. Input the name e.g. owncloud
  4. Select the CoreOS template
  5. Select the size: small and 10 GB are enough
  6. Take a security group which has TCP port 80 and 443 open
  7. Paste the following in the userdata box

    ```

    cloud-config

    hostname: owncloud

    write_files: - path: /var/owncloud/config/empty permissions: 0644 owner: root - path: /var/owncloud/data/empty permissions: 0644 owner: root

    coreos: units: - name: docker.service command: start - name: ow.service command: start content: | [Unit] After=docker.service Requires=docker.service Description=starts Owncloud

        [Service]
        TimeoutStartSec=0
        ExecStartPre=/usr/bin/docker pull owncloud
        ExecStart=/usr/bin/docker run -d -p 80:80 -p 443:443 -v /var/owncloud/config:/var/www/html/config -v /var/owncloud/data:/var/www/html/data owncloud
    

    update: reboot-strategy: reboot ```

  8. Launch your instance

  9. Wait 1 minute and then open the IP address in your browser

You are then faced with the usual configuration wizard from Owncloud to create an admin user and finish setup.

You can add unlimited storage to this Owncloud installation by linking to Exoscale Object Storage

What happens

Here we are creating a CoreOS compute instance and injecting in it the above userdata. This userdata gets interpreted as a Cloudinit template which give the instance:

  • its name
  • tells it to start Docker on boot
  • Create a new service called ow
  • Defines this service as being a Docker container
  • Pulls the official Owncloud image from [Docker Hub]
  • And runs it exposing port 80