Installing Cloudron on a Home Server

By Girish on Friday, April 13th 2018

For those unaware, Cloudron is a platform that makes it easy to run web apps on your server and keep them up-to-date. Think SaaS for self-hosted apps.


Cloudron works best on public VPS providers like Digital Ocean, Vultr, Linode. This is simply because those servers come with a public IP out of the box and the default firewall allows incoming traffic from all TCP ports to the server.

A little known secret is that Cloudron works just fine on a Home Server! It just needs a little technical know how of your home network.

In this post, we will see how to install Cloudron on a home server. The setup described here is for a home server installation that can be accessed from outside home as well.

Prerequisites

Cloudron requires the following:

  • A public IPv4 address. This IP address does not need to be static. Cloudron has a feature where it will continually keep your DNS updated with a dynamic IP address. You can visit this site to view your current public IP address.

  • Forward port 80 and port 443 from your router to the Home Server IP. For this, you have to login to your router and setup port forwarding in the firewall. See this site for router specific instructions on how to setup port forwarding.

  • NAT loopback support in your router. Cloudron apps are accessed using domain names and the DNS entries point to the public IP of your home network. When apps are accessed with the DNS name from inside your home, the router needs to be capable of routing the public IP back ('hairpinning') to your home server. Most modern routers support this.

Installation

Create a fresh server (VM or baremetal) with Ubuntu Xenial (16.04 x64) and run these commands:

wget https://cloudron.io/cloudron-setup
chmod +x ./cloudron-setup
./cloudron-setup --provider generic

Domain setup

Once installation is complete, navigate to https://IP. If you meet the pre-requisites above, you should be able to use your current public IP address. If you are unable to access with the public IP address, now is a good time to investigate what is failing.

Provide a domain name to complete the installation:

We recommend choosing one of the automated DNS providers like Cloudflare, Digital Ocean and Route 53.

If you use the wildcard or manual DNS with a dynamic IP address, you have to setup some other way to keep the DNS in sync with your public IP.

Admin setup

Once DNS is setup, Cloudron will redirect to https://my.domain.com. The browser address bar will show a green lock to indicate that the connection to your Cloudron is now secure (It does this by automatically getting a certificate via Let's Encrypt).

Appstore setup

You are now ready to start installing apps! When you click on the App Store link in the UI, you will be prompted to create a cloudron.io account. This account is used to manage your subscription & billing.

Enable Dynamic DNS

If you have a setup where you have a dynamic public IP, the Cloudron has to be configured to keep the DNS updated. For this, SSH into your server and run the following commands:

mysql -uroot -ppassword -e "INSERT box.settings (name, value) VALUES('dynamic_dns', 'enabled')"
systemctl restart box

Other notes

  • Remember to port forward TCP ports from the router to the server when using non-HTTP(S) ports. For example, you might have to forward SSH ports for git to work when using Gogs, Gitea & GitLab.

  • Cloudron requires port 80 (HTTP) to be forwarded at all times for the Let's Encrypt integration to work. Cloudron itself serves web pages only on 443 (HTTPS).

  • Cloudron requires x86 and does not work on Raspberry Pi.

Comments?

Comments/Suggestions/Feedback? Discuss in our forum.