Skip to main content

Docker Install of Remotely

Install Remotely using Docker and NGinX Proxy Manager

First you'll need to have Docker-CE installed, on your desired host.  If you want a fairly easy / safe way to also access your remotely server from outside your local network, you'll want to install and setup NGinX Proxy Manager in Docker as well.

See the following articles / Videos for instructions on setting thoe up.

Installing Docker-CE and Docker-Compose

You can easily install Docker-CE, Docker-Compose, Portainer-CE, and NGinX Proxy manager by using this quick install script I created and maintain on Github.  Just use the command:

wget https://gitlab.com/bmcgonag/docker_installs/-/raw/main/install_docker_nproxyman.sh

To download the script to your desired host.

Change the permissions to make the script executable:

chmod +x ./install_docker_nproxyman.sh

and then run the script with the command:

./install_docker_nproxyman.sh

When run, the script will prompt you to select your host operating system, then will ask you which bits of software you want to install.

Simply enter 'y' for each thing you want to install.

At some point, you may be asked for your super user (sudo) password as well.

Allow the script to complete installation.

At this point, you might want to log out and back in, as this will allow you to use the docker and docker-compose commands without the need of sudo in front of them.

Once you've setup Docker and NGinX Proxy Manager (known as NPM from here on), you're ready to install Remotely via Docker.

Again in a terminal window enter the following command:

docker run -d --name remotely --restart unless-stopped -p 5000:5000 -v /remotely-data:/remotely-data translucency/remotely:latest

In the above command, you'll be running the container as a daemon (-d) so it doesn't stop running when you exit the command line interface (terminal / shell).  You're telling the container to restart automatically unless you specifically stop it with the docker stop remotely command, and you are mapping port 5000 on your host machine to the port 5000 on the docker container.  Finally, you're setting up a volume mapping on th ehost from /remotely-data to the container folder /remotely-data.  This mapping will allow you to keep backups of your remotely information by simply copying the folder to an external drive or NAS as desired.

Once you have the command entered, press the Return / Enter key an dlet the server start up.  As long as you don't get any errors in the terminal, you should be able to access your install at the IP address of your host machine on port 5000.  If you have port 5000 already in use on the host, you can change the port on the left side of the colon ":" in the command to any free port on your machine.  I believe I used 8282.

So I then went to http://192.168.7.51:8282 in my browser to make sure the UI came up.

Proxy the local address to a domain

I want to access my install, and make it accessible to clients through the internet, so I need a way a domain name (remotely.routemehome.org) to route to my home, and then to my docker container.

For this we use NPM.  Presuming you already have it setup and accessible, log into NPM, and create a new Host entry.  You need to make sure the domain you'll use points to your home IP.  For this you can register a domain and create a wildcard A record (*) to point to your home's public IP, or you can use a service like DuckDNS to get a duckcns.org domain and have it update your IP as it changes over time. Other options also exist like CloudFlare's dynamic DNS options, but choose whichever options works best for you.

Here's a video on using DuckDNS for getting a URL that will get you back to your homelab stup.

Now, in the host entry, enter the domain or subdomain that you'll sue for your Remotely install.  I chose remotely.routemehome.org.

Next, enter the IP address of the docker-gateway for your Remotely install.  If the Remotely container and the NPM containers are on different host machines, then use the IP address of the host that the Remotely container is running on.

Next, enter the port of the "host".  5000 if you didn't change it.

Enable Websockets, and Block common exploits, then save.

Click on the URL in the list, and make sure you get the Remotely Registration page.  Once you've got that set, we just need to edit our entry, and move to the SSL tab.  

On the SSL tab, select to "Request a New Certificate" from the drop down, enable Force SSL, enter your email address, and agree to the LetsEncrypt terms of service.  

Click 'Save'.  As long as no errors are shown, you should now be able to open your Remotely site, and be automatically sent to the SSL page.

Register your first user / admin account, and get to supporting people.