Setting up Nextcloud and ONLYOFFICE with Cloudron on Digital Ocean

In this post, I will provide a guide on how I setup my own platform to replace Google Drive. The core of the platform is Nextcloud. It has ONLYOFFICE enabled. It is built with Cloudron and hosted on Digital Ocean. Nextcloud is one of the most impressive tool I’ve ever used, and so far I couldn’t be happier with this platform. In addition, the running cost of it all is very low, around a simple meal per month. I am only paying for my domain name and Digital Ocean, the rest is for free!

If you intend to use this setup, please firstly read the entire post before going ahead.

Overview

As part of my quest to move away from Google services as much as possible, I needed a platform to replace Google Drive. This platform has to be private and secure. Fortunately I found Nextcloud. Combining with ONLYOFFICE (not a typo, it is all capital letters…), it has become the Google Drive and Google Docs replacement I was looking for:

  • Secure.
  • Private.
  • I can store, share, view and edit files, including spreadsheets, all in one central place.
  • I can manage and view photos from different devices.

Furthermore, my Nextcloud server is self-hosted. This means it is not hosted by another company, making it arguably more secure and private. The hosting company is the well-known cloud host provider Digital Ocean. It provides the infrastructure backbone such as hosting, backup and DNS management. Cloudron is the service provider that helps me to set it all up painlessly with just a few clicks.

Digital Ocean

Digital Ocean is the cloud hosting provider where you can create your own server in minutes, which can be accessed on the Internet. You can also easily boost your server with more computing power. In addition, it provides other important services such as DNS management and backing up of servers.

Cloudron

Cloudron is the cloud based platform where you can install powerful web apps on your own server. It is used to install Nextcloud. As an added bonus, it will also setup an email server, allowing you to send and receive emails using your own domain! Having my own email server was important for me.

Cloudron takes all the technical administrative tasks away from you, which is so important for people who are not skilled system administrators like myself. Think of Cloudron like a desktop app installer – you install the desktop apps with just a few clicks without running complicated commands and other technical tasks.

ONLYOFFICE

ONLYOFFICE is an online document editing platform, where you can edit word, spreadsheet and presentation documents all in one place. It is 100% compatible with Microsoft Office. I really needed this as I often edit spreadsheets and documents from various devices. It has been fantastic so far. The only downside is I spent quite a bit of time trying to integrate it with Nextcloud but had no luck.

Nextcloud

Nextcloud is the heart and soul of my platform. It is a hub where you can manage all your files, such as photos and documents. In addition, it provides many apps such as productivity and collaboration tools. It prides itself on being private and secure. It is open source, meaning the code is completely transparent, allowing anyone to see how it works, making it even more secure. And yes, it comes with mobile apps on Android and iPhones!

Before We Start…

Some basic knowledge of setting up domains is required, as there will be some configuring of DNS. It is best to have your domain available already so you can access it on the web and mobile devices. It is also preferable to setup a Digital Ocean account beforehand since it is the starting point. Be prepared to restart the whole process again – I certainly fumbled around and restarted the whole processes a few times!

Let’s Go!

  1. Make sure your domain is available and is not currently used. I bought mine from Namecheap.
  1. Get ready to create a droplet. A droplet is Digital Ocean’s name for a cloud server. Because we are going to use Cloudron, the name of the droplet (i.e. server) needs to be in this format:

my.my-domain-name.com

Note the “my” part at the front of the name. Having this format allows Digital Ocean to create a PTR record behind the scenes, which can then be used by Cloudron to setup a complete email server. If you don’t need your own email server here, which I think would be a shame as it is for free, then you can use other names for the droplet. In this guide we will use my-domain-name.com as the domain.

  1. Now create the droplet in Digital Ocean. In the Create Droplets page, go to the Marketplace and look for Cloudron:
  1. On the Create Droplets page, ensure the hostname is set to my.my-domain-name.com (see image below). I selected the $5 droplet with 1 GB memory, 1 CPU and 25 GB disk space, which was enough for my needs. I also enabled IP6 and enabled backup.
  1. The droplet should be created within a few seconds. The next step is to assign it to a domain. We do this by going to the Network section on the left menu in Digital Ocean and add your domain there. Do not include the “my” part. So in the Enter domain box, it would be something like: my-domain-name.com.
  1. After the domain has been added, there should be 3 NS records listed, like the image below.
  1. Now let’s add the default two A records and one AAAA record for IP6. Digital Ocean provides a nice feature to allow you to select the desired droplets when creating the records. When finished, the records should look something like the following:
  1. After the DNS records are set in Digital Ocean, I also went back to my domain host Namecheap and changed the 3 NS records to the same as above. I am not entirely sure I needed to duplicate the 3 NS records in both Digital Ocean and my domain host Namecheap, but I did it anyway just in case.
  1. So at this point, the DNS records will tell the world that your domain will be pointing to the IP address of the new droplet. The settings for the DNS records can take a few hours to propagate across the globe, so you might need to wait for a few hours. To check whether the DNS changes are propagated, I ran a “ping” command on my Windows machine:

In the screenshot above, I received replies, meaning my Digital Ocean droplet could now be accessed via my domain on the Internet! So when you have reached this point, it is time to start setting up Cloudron, Nextcloud and ONLYOFFICE!

  1. In Digital Ocean, get the IP4 address of the droplet and open it in a web browser. You will get a warning about the site not being secure or private. Ignore it for now and continue.
  1. You will then see the Cloudron domain setup page. This is why we needed to have the domain setup properly in previous steps. Type in your domain my-domain-name.com and select Digital Ocean as the DNS provider. Now we need the Digital Ocean API token, which we will get now.
  1. The API token allows other apps and services to modify certain settings in Digital Ocean. In our case, Cloudron would need to update some DNS records in Digital Ocean for it to work properly. To get the token, click on API in Digital Ocean in the side menu. Click on Generate New Token to complete. It is important that you keep the token safe somewhere so you can access it later. I already have one setup as shown below:
  1. Now come back to the Cloudron domain setup page and paste the token on the page to complete. I left the advanced settings untouched. Cloudron will now setup the site and can take a few minutes to complete. The setup also includes getting an SSL certificate (with multiple sub-domains) so all traffic will be secured with the HTTPS protocol.
  1. Next you will see the page to setup the admin account. Fill in the details.
  1. If all goes well up to this point, congratulations, and you should see the main Cloudron page where it is saying there are no apps installed yet! The next steps are for configuring Cloudron and setting up Nextcloud with ONLYOFFICE.
  1. Before I installed any Cloudron apps, I configured my Cloudron settings, which can be accessed in the top right corner of the Cloudron main page. I updated my profiles and enabled email, so I could use it later. This step won’t cover the email setup in detail, Cloudron has very good documentation on this. To enable it, simply click on the Enable button in the Mailboxes tab. Then go to the Status tab, where you might need to click on the Re-setup DNS button and wait for a few minutes. In the best case scenario, all the statuses will be green, indicating you have a mail server setup and ready to go!
  1. The next step is to install Nextcloud. To do so, click on App Store in the top menu on the main Cloudron page. You will then be prompted to create a Cloudron.io account or login if you already have an account.

It is important to note that currently you only can have 2 apps installed with a free Cloudron.io account. To install more, currently the only option is to subscribe for $30 USD per month. Fortunately my real need is only to use Nextcloud which is just one app. The screenshot below shows the Nextcloud app on the App Store page.

  1. After you have found the Nextcloud app in the Cloudron App Store, select it to install it. You will be prompted with some setup parameters, like the screenshot below. Fill it in as you wish. In my case, I chose to use Nextcloud to be located at the root domain, so I left Location empty. This will give you the URL (web address) where you can access your Nextcloud platform.

In my case, I want to install Nextcloud at the root domain, so I left the Location field empty. A warning dialogue was shown, asking me if I wanted to override, which was what I wanted. This way, I could access my Nextcloud hub on my-domain-name.com.

  1. The installation will only take a couple of minute to finish and when it does, you will see the Nextcloud icon listed in the Cloudron main page. You have successfully installed Nextcloud with Cloudron! You might want to explore the configuration options by clicking on the clog wheel. Otherwise, click on the icon and ready to log in! The image below shows what the main Cloudron page looks like after Nextcloud has been installed successfully.
  1. You will then be prompted with this screen as you will be logged in as an admin. Nextcloud comes with many good apps that you can install and use. They can only be installed with an administrative account, such as the default Cloudron admin account.
  1. Once you are logged in, please change the password immediately. Then you can explore and configure Nextcloud to your heart’s content! The next step is to enable ONLYOFFICE in Nextcloud.
  1. To start using ONLYOFFICE, we just need to enable two apps in the Nextcloud apps. When I first did my setup, I had to install ONLYOFFICE as a separate Cloudron app. Cloudron took care of the installation and seamlessly hooked up Nextcloud and Cloudron together behind the scenes. Everything worked without me doing much. As mentioned previously, I could never setup ONLYOFFICE to work with Nextcloud manually, so this was a life-saver.

However, a few days after I got everything working, I saw a Nextcloud tweet saying that ONLYOFFICE is installed by default in Nextcloud. In other words, ONLYOFFICE comes out-of-box with newer versions of Nextcloud. Remember, the free version of Cloudron allows a maximum of 2 apps installed. I could now remove ONLYOFFICE, and install some other app to run alongside Nextcloud! Everything just keeps getting better. 🤩

  1. Now we will enable ONLYOFFICE in Nextcloud. Login to Nextcloud as an administrator and under the account icon in the top left corner, select the Apps option. Find the Community Document Server App, which should be under the “Office & text” category menu item on the left menu. Click on the “Download and enable” option, and you are almost finished! The screenshot below shows the Community Document Server App enabled.
  1. Now find the ONLYOFFICE App, which again should be under the “Office & text” category menu. Click on the “Download and enable” option, and this completes the process of enabling ONLYOFFICE. The screenshot above shows both the Community Document Server App and the ONLYOFFICE App enabled.
  1. To test if everything works, go back to the Nextcloud documents page, click on add button. If you see the options to create spreadsheets and documents, congratulations!

Mobile

Fortunately Nextcloud comes with mobile apps. I have an Android phone, so I downloaded the app from the Android Play Store. All you need to do is to give the app your Nextcloud URL (see step 18). What I love about the app is you can configure it so it can seamlessly upload the photos. It also comes with a screen lock mechanism where you need to enter a passcode to access it, making it so much more secure on the mobile devices.

Wrapping Up

That’s it! I hope this guide has helped. I have been using my Nextcloud hub on a daily basis for a few weeks, and I am grateful that all these tools exist to make my digital life so much simpler, organised, secure and private.

Leave a Reply

Your email address will not be published. Required fields are marked *