How to use Nextcloud file syncing with Meshnet
Learn how to deploy a Nextcloud Docker container for remote file syncing over Meshnet.
Introduction
Nextcloud is a free and open-source online collaboration platform. It offers a wide range of tools and applications, such as file sharing and synchronization, calendar, tasks, and workflow integrations. Nextcloud is scalable from personal use to enterprise-level environments.
In standard configurations, to share your Nextcloud servers with remote devices, you must set up public domain names and SSL certificates or port forwarding, which can be both expensive and time-consuming.
With Meshnet, you can forget about the difficult networking procedures. With only a couple of tweaks to the Nextcloud configuration, your Meshnet peer devices can access the server over encrypted, private network tunnels without exposing Nextcloud to the internet.
While Nextcloud can be set up using various methods, such as a virtual machine or a standalone operating system, this article will show you how to run Nextcloud in a Docker container and access it over Meshnet.
Install Docker
To begin the configuration, you must have Docker installed on your device. Instructions on how to download and install Docker can be found on the Docker website:
Create a Nextcloud Docker container
After installing Docker on your system, you have the ability to deploy various applications and services as Docker containers. Now you can proceed with creating your Nextcloud container.
Creating a volume
First, you need to create a specific Docker volume (directory) where the container’s files will be stored.
Method 1: Using Docker Desktop
This method utilizes the Docker Desktop application to create a volume for the Nextcloud Docker container.
Open the Docker Desktop application.
From the menu on the left, select Volumes.
Click the Create button in the upper-right corner.
Name it
nextcloud
and click Create.The newly created volume will now be visible in the Volumes section.
Method 2: Using the command line
This method shows you how to create a volume for your Nextcloud Docker container via the command line.
Open Command Prompt (on Windows) or Terminal (on Linux or macOS).
Run the following command to create a volume called
nextcloud
:
If the creation was successful, you will see the name of your volume in the command line window.
Deploying a container
Once the volume has been created, you can deploy the Nextcloud container itself.
Open Command Prompt.
Execute the following
docker run
command:
Docker will pull the Nextcloud image from Docker Hub and create the container.
Set up Nextcloud
With the container up and running, your Nextcloud service is listening on port 8080 (unless changed in the docker run
command). To complete the initial configuration, do the following:
Open your internet browser and visit this URL:
http://localhost:8080/
Enter authentication details for your admin account, select the preferred database, and click Install.
Finish the setup procedure by following the on-screen instructions.
Now, you have a fully customizable Nextcloud instance.
Allow Meshnet connections
At this time, Nextcloud is only reachable from the host device. You need to adjust its configuration file to allow connections over Meshnet.
Method 1: Using Docker Desktop
This method uses the built-in terminal in Docker Desktop to make changes.
Open Docker Desktop and click your Nextcloud container entry.
Switch to the Terminal tab.
Run the following command to update the repository list, install Nano, and open the
config.php
file using Nano:Locate the
trusted_domains
array and append the following two lines, where<NordName>
is the host device’s Nord name and<MeshnetIP>
is the host device’s Meshnet IP address:Example
Press Ctrl + X, Y, and Enter to save changes and exit.
Restart the Nextcloud container to apply the changes by clicking the restart button in Docker Desktop.
Method 2: Using the command line
This method uses Nextcloud’s built-in command-line interface called occ
.
Open Command Prompt (on Windows) or Terminal (on Linux or macOS).
Add new trusted domains by executing the following two commands, where
<NordName>
is the host device’s Nord name and<MeshnetIP>
is the host device’s Meshnet IP address:Example
Check if the Nord name and Meshnet IP address have been assigned by running this command:
Restart the Nextcloud container to apply the changes.
Connect to Nextcloud over Meshnet
After adding the Meshnet addresses to the trusted domains, your Nextcloud instance can be reached by Meshnet peer devices.
Note
If you're hosting Nextcloud on a Linux device, you must grant the local network permission for the devices accessing it. For more information, see Common issues on Linux.
Method 1: Using Nextcloud software
To use file syncing between different machines, you need to install the Nextcloud application on client devices.
Note
Folder synchronization is possible only on desktop devices. On mobile devices, you can only upload and download files manually.
Download and install the Nextcloud application from the Nextcloud website.
Launch Nextcloud and click Log in.
In the server address field, enter
http://
, followed by the Nord name of the host device, and:8080
.Example
http://secret.meerkat-himalayas.nord:8080
Click Next and proceed with the login procedure.
Select your folder synchronization options and click Connect.
Nextcloud settings can now be accessed from the system tray (on Windows) and the menu bar (on macOS or Linux).
Tip
For ease of use, you may download the Nextcloud application from the Snap Store on compatible Linux distributions.
Method 2: Using an internet browser
To access the Nextcloud dashboard via a browser, do these steps:
Copy the Nord name of the host device from the NordVPN application.
Open your internet browser.
Paste the copied Nord name followed by
:8080/
to the URL field and press Enter. Examplesecret.meerkat-everest.nord:8080/
Log in to your account.
Now you can freely navigate your Nextcloud from a remote device. You can view, upload, or remove files and use all other applications inside Nextcloud.
Last updated