Cloud access to your files, like Google Drive, Box, One Drive, Dropbox... there are more... has become big business recently. It's something which allows us to access our documents wherever we are, on almost any platform. While I believe they still have a place for most home users (and also businesses) I'd like to offer an alternative.
For those of us with the time and inclination, there's a good range of self-hosted options to choose from, allowing us to create and manage our own cloud storage without needing to rely on the big boys.
There are some criteria we require in choosing our self-hosted cloud storage:
- It's available as a docker image, and still has active support from the developers
- It allows for multiple users, both admin and regular
- It can be self-hosted, and can be accessed via reverse proxy
- It has good security options, such as 2FA
- It offers file encryption
- It has a supported phone app
- It supports public, shareable links (for when you just have to share that funny photo with someone who isn't a user)
- At its core, it's a document storage solution
In my mind, there are two applications which cover all of the above: ownCloud, and Nextcloud. The latter is an offshoot of the former, and supposedly more developed. It definitely provides more options for integrations, plugins and varied functionality. However it's also (in my experience) a bigger resource hog, and did not play well during a container migration. Feel free to try Nextcloud, I know those who swear by it. Try ownCloud, see how they compare. Personally, I don't need all the bells and whistles which Nextcloud tries to add, so today I'll talk you through ownCloud.
We will cover: the server installation via docker; initial setup steps once you've accessed your ownCloud instance; installing the Windows sync tool; installing ownCloud for Android (which is practically the same as for iPhone).
Prepping your system
This process will install three containers - ownCloud, MariaDB, and Redis. Let's prep our file system:
- Navigate to the directory where you store your container config and persistent folders, and create one called
owncloud(lowercase is important, and will continue to be so throughout this walkthrough)
- Inside your
owncloudfolder, create three more called
- Still inside the
owncloudfolder, create a file called
- Make sure you know the IP address of your host machine (NAS, Raspberry Pi, whatever it is). On linux based systems you can do this from the command line by typing in
ifconfigand finding the correct network adapter. On windows machines, open up a command prompt or terminal and the command is
- SSH into your machine, and create a docker network for your ownCloud instance by typing
sudo docker network create owncloud. Again, the letters are case sensitive
Creating your containers
We can now get on with the business of creating the containers.
- Navigate to and open the
docker-compose.ymlfile we created in step 2 above (use whichever method you're most comfortable with, SSH and vim, SMB via windows, whatever)
- Copy paste the following, and then make sure to pay attention to the parts that need to be changed:
Some things to change above:
- If you change the owncloud port mapping, make sure you reflect this in the
- Set your host machine's IP address as the
OWNCLOUD_DOMAIN, followed by the owncloud published port (the number before the
:specified in the
- If you plan on using multiple domains to access your OwnCloud instance (such as locally via IP, but also via a personal domain such as
owncloud.yourcooldomain.comwith a reverse proxy) then you must add each trusted domain as comma separated without whitespace, i.e.
- Make sure to set usernames and strong passwords where specified
- Make sure to change your volume paths to those which were created on your host machine
owncloudcontainer and the
Once you're happy you have the right information included, it's time to create the containers:
- Log in to your host machine via SSH
- Navigate to the directory which holds your
- Type the following command:
- Watch the CLI window as it downloads the images and creates the containers - the actual owncloud container will be created last
or copy/paste the above stack to Portainer and hit the blue 'Deploy the stack' button after making the relevant changes
All being well, you should now have the three containers created.
In your browser's address bar, enter
serverIP:8080 (if you changed the port mapping in the compose above, you need to use whatever port you specified here as well).
You should be shown the following screen:
Enter the the username and password you set above for
OWNCLOUD_ADMIN_PASSWORD and you should be logged in, with the screen changing to something similar to this:
- This button opens a small drop-down menu where you can select things like admin settings
- This hamburger/3-line menu button is where you will access the different apps or add-ons you may integrate, such as a calendar or a music player. It's also where you will be able to find the 'Market' app, which is where you can browse the official integrations available to you
+allows you to add files or folders, or upload
Initial recommended steps
The following can all be done from the
Settings page using your admin user
Enable 2-factor authentication (2FA)
Click on the 'Apps' menu in the left hand navigation panel, and then search for
2-Factor Authentication. Click the 'Enable' button. The next time you or another user logs in, you will be required to set up 2FA on your device (like a mobile). This is extremely useful (and important) for safety when exposing your ownCloud instance to the web.
Take some time to explore the other apps which are already listed here. You can disable/enable as you wish, but be aware that disabling certain services may cause breaking changes to occur to your setup.
Set up your mail-server credentials
If you have your own mail server, you can set up an admin email account which will mail users on certain events, such as when they change their emails, if a document is shared with them, etc.
Head over to the 'General' menu in the left-hand navigation pane, and input your mail-server credentials at the top of the screen:
This page also offers mail templates if you create a theme, and general logs options.
Click the 'Encryption' menu in the left-hand navigation pane. At the top of the screen you'll see a checkbox to enable server-side encryption.
Once you click it, a red text box will appear which explains various need-to-know information. Once you've read it and are satisfied, click the button labeled 'Enable encryption'
Hit the button top right, then select
Users from the drop-down box. The screen you're shown will initially be pretty empty, and will only include your admin user.
There are 3 main areas to this page. The main one is where your users are listed. Here, as the admin, you can change any user's password, the group(s) they're part of, assign whether or not a user can be an admin for a particular group, and set a storage quota for them (1GB, 5GB, Unlimited, etc.).
The far left panel allows you to create and quickly view your groups.
Finally, at the top of the screen under the ownCloud bar you will be able to add a user. If you've set up your mail-server correctly following the steps above, enter their email address as well. Once you hit the 'Create' button, your new user will be emailed with a temporary password to access ownCloud, and will then be asked to change it on their first login. If you've enabled 2FA already, they will also be asked to set that up.
Setting up your apps (windows and mobile)