# How to set up a remote Airsonic music server

## Introduction <a href="#introduction" id="introduction"></a>

In today's digital landscape, cloud-based audio services have become the go-to choice for many individuals seeking convenient access to their music. However, these solutions often fall short when it comes to providing access to personal audio files stored on separate devices. This limitation emphasizes the importance of finding a solution that grants users full control over their audio streaming experience, leading many to explore the option of setting up their own music servers.

[Airsonic](https://airsonic.github.io/) is a self-hosted, free, and open-source application that enables you to easily configure a personal music server. This tool is optimized for various audio formats and large music collections. While self-hosting a server can be an exciting learning experience, setting up secure remote access may be the opposite.

Tinkering with [port forwarding](https://nordvpn.com/blog/port-forwarding/) or looking for available domain names can be tedious work. With [Meshnet](https://nordvpn.com/meshnet/), you can allow remote connections to your server without any difficult networking configurations. In addition, you do not have to expose any ports on your server.

This guide contains instructions on how you can set up your own Airsonic music server on Windows, macOS, and Linux devices using Docker, and access the server remotely using Meshnet.

## Prerequisites <a href="#prerequisites" id="prerequisites"></a>

To follow this guide, you must have [Docker](https://docs.docker.com/get-started/overview/) and [Docker Compose](https://docs.docker.com/compose/) installed on your device. Instructions on how to download and install these tools can be found on the Docker website:

* [Docker Desktop instructions for Windows](https://docs.docker.com/desktop/install/windows-install/)
* [Docker Desktop instructions for macOS](https://docs.docker.com/desktop/install/mac-install/)
* [Docker Desktop Instructions for Linux](https://docs.docker.com/desktop/install/linux-install/)
  * [Docker Engine instructions for Linux (CLI only)](https://docs.docker.com/engine/install/)
  * [Docker Compose instructions for Linux (CLI only)](https://docs.docker.com/compose/install/linux/)

{% hint style="info" %}
**Note**

Docker Compose comes pre-installed with Docker Desktop.
{% endhint %}

## Deploy Airsonic using Docker <a href="#deploy-airsonic-using-docker" id="deploy-airsonic-using-docker"></a>

With Docker and Docker Compose installed, you can begin setting up your Airsonic music server. Running the Airsonic server as a Docker container requires fewer resources than a standalone installation. Besides, you can easily make changes to the server’s configuration by adjusting the Docker Compose file and restarting the container.

### Creating a Docker Compose file <a href="#creating-a-docker-compose-file" id="creating-a-docker-compose-file"></a>

First, you need to create a Docker Compose file that contains the deployment instructions for the Airsonic Docker container.

{% tabs %}
{% tab title="Windows" %}
To create a Docker Compose file for Airsonic on Windows:

1. Open **PowerShell**.

2. Run the following command to create a new `airsonic` folder with a `data` subfolder, and then navigate to the `airsonic` folder:<br>

   <pre class="language-bash" data-overflow="wrap"><code class="lang-bash">mkdir airsonic/data; cd airsonic
   </code></pre>

   &#x20;

   <div align="left"><figure><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2FoyWzfMK53MjeMyF1hgJB%2Fairsonic_win_mkdir.png?alt=media&#x26;token=4c5bd069-ad4d-4089-89b5-e9214e95f75a" alt="PowerShell output after creating the required directories and navigating to the &#x27;airsonic&#x27; folder."><figcaption></figcaption></figure></div>

3. Create a `docker-compose.yml` file and open it using Notepad with the following command:<br>

   <pre class="language-bash" data-overflow="wrap"><code class="lang-bash">notepad docker-compose.yml
   </code></pre>

   \
   When prompted to create the file, click **Yes**.\
   \
   ![Confirming to create a new file in the Notepad dialog.](https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2FeSwUhG0u2i0TTbiAjiUc%2Fairsonic_win_compose_create.png?alt=media\&token=97729a3e-4cfb-436c-b305-d2a93231c3b7)

   &#x20;

4. In the Notepad window, paste the following information containing instructions for the [Airsonic-advanced Docker container](https://hub.docker.com/r/airsonicadvanced/airsonic-advanced):<br>

   <pre class="language-yaml" data-overflow="wrap"><code class="lang-yaml">version: "3"
   services:
     airsonic-advanced:
       container_name: airsonic-advanced
       image: airsonicadvanced/airsonic-advanced:latest
       restart: unless-stopped
       ports:
         - 4040:4040
         - 4041:4041
       environment:
         TZ: &#x3C;YourTimezone>
       volumes:
         - &#x3C;\path\to\music>:/var/music
         - &#x3C;\path\to\playlists>:/var/playlists
         - &#x3C;\path\to\podcasts>:/var/podcasts
         - ./data:/var/airsonic
   </code></pre>

   &#x20;

5. Replace the placeholders with the values appropriate for your setup:
   * Instead of `<TimeZone>`, enter your [time zone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).
   * Instead of `<\path\to\music>`, enter the path to your music folder.
   * Instead of `<\path\to\playlists>`, enter the path to your playlists folder.
   * Instead of `<\path\to\podcasts>`, enter the path to your podcasts folder.\
     \
     **Example**

     <div align="left"><figure><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2FCccHzpsAJPqO1pVyMo6O%2Fairsonic_win_compose_file.png?alt=media&#x26;token=7d1fe415-5b98-440b-9dd8-00cd13664040" alt="Example Docker Compose file for Airsonic on Windows."><figcaption></figcaption></figure></div>

6. Press **Ctrl** + **S** to save changes.

7. Exit **Notepad**.
   {% endtab %}

{% tab title="macOS and Linux" %}
To create a Docker Compose file for Airsonic on macOS and Linux:

1. Open **Terminal**.

2. Run the `id` command to find the `uid` and `gid` values for your user account.<br>

   <div align="left"><figure><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2FgMtkTrCAcXuXjx43eOkd%2Fairsonic_linux_id.png?alt=media&#x26;token=1be20c39-eba3-4157-aba3-b3a6143d4d8d" alt="UID and GID values underlined in the terminal output."><figcaption></figcaption></figure></div>

3. Run the following command to create a new `airsonic` folder with a `data` subfolder, and then navigate to the `airsonic` folder:<br>

   <pre class="language-bash" data-overflow="wrap"><code class="lang-bash">mkdir -p airsonic/data &#x26;&#x26; cd airsonic
   </code></pre>

   &#x20;

4. Create a `docker-compose.yml` file and open it using the Nano text editor with the following command:<br>

   <pre class="language-bash" data-overflow="wrap"><code class="lang-bash">nano docker-compose.yml
   </code></pre>

   &#x20;

5. In the terminal window, paste the following information containing instructions for the [Airsonic-advanced Docker container](https://hub.docker.com/r/airsonicadvanced/airsonic-advanced):<br>

   <pre class="language-yaml" data-overflow="wrap"><code class="lang-yaml">version: "3"
   services:
     airsonic-advanced:
       container_name: airsonic-advanced
       image: airsonicadvanced/airsonic-advanced:latest
       restart: unless-stopped
       ports:
         - 4040:4040
         - 4041:4041
       user: &#x3C;UID>:&#x3C;GID>
       environment:
         TZ: &#x3C;YourTimezone>
       volumes:
         - &#x3C;/path/to/music>:/var/music
         - &#x3C;/path/to/playlists>:/var/playlists
         - &#x3C;/path/to/podcasts>:/var/podcasts
         - ./data:/var/airsonic
   </code></pre>

   &#x20;

6. Replace the placeholders with the values appropriate for your setup:
   * Instead of `<UID>` and `<GID>`, enter your user account’s values from Step 2.
   * Instead of `<TimeZone>`, enter your [time zone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).
   * Instead of `</path/to/music>`, enter the path to your music folder.
   * Instead of `</path/to/playlists>`, enter the path to your playlists folder.
   * Instead of `</path/to/podcasts>`, enter the path to your podcasts folder.<br>

     **Example**

     <div align="left"><figure><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2F1JH3QGlYVGfxnWbe4kpb%2Fairsonic_linux_compose_file.png?alt=media&#x26;token=87f937e8-26dd-418e-9793-eb6372bd9eb6" alt="Example Docker Compose file for Airsonic on Linux."><figcaption></figcaption></figure></div>

7. Press **Ctrl** + **X**, **Y**, and **Enter** to save changes and exit.
   {% endtab %}
   {% endtabs %}

### Starting the Airsonic container <a href="#starting-the-airsonic-container" id="starting-the-airsonic-container"></a>

With the Compose file created, while in the `airsonic` directory, execute the following command in the command line to create your Airsonic instance:

{% code overflow="wrap" %}

```bash
docker-compose up -d
```

{% endcode %}

Docker will [pull the Airsonic-advanced image](https://docs.docker.com/engine/reference/commandline/pull/) from Docker Hub and create the container.

You can run the `docker ps` command to check if your Airsonic container is up and healthy.

<div align="left"><figure><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2FucyWSpCHYjsmNLfafdKc%2Fairsonic_docker_ps.png?alt=media&#x26;token=29deaaf5-e047-4046-8aff-560798cd57b3" alt="Output of the &#x27;docker ps&#x27; command showing that the Airsonic container is active."><figcaption></figcaption></figure></div>

## Access the Airsonic web interface <a href="#access-the-airsonic-web-interface" id="access-the-airsonic-web-interface"></a>

Now that the server is active, you can control all of its settings using the Airsonic web interface. To access the web interface:

1. Open your internet browser.
2. Navigate to the following URL:\
   `localhost:4040/login`<br>
3. In the **Username** and **Password** fields, enter `admin` and click **Log in**.<br>

   <div align="left"><figure><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2FpyE9xd7DewMvlTZOodeb%2Fairsonic_web_login.png?alt=media&#x26;token=92b269b8-c836-46a1-993b-d06b868b5538" alt="Logging in to the Airsonic web interface using the default credentials."><figcaption></figcaption></figure></div>

Upon logging in, you will be redirected to the Airsonic “Getting started” page. You can disable this page by clicking **Don’t show this again**.

### Updating the administrator account credentials <a href="#updating-the-administrator-account-credentials" id="updating-the-administrator-account-credentials"></a>

It is essential to secure administrator access to your Airsonic instance with strong credentials. To update the login details for the administrator account:

1. In the upper-right corner, click **admin** and select **Credentials**.

2. Click **Add credentials**.

3. Enter your new password twice, select its expiry date, and click **Create**.<br>

   <div align="left"><figure><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2F9NlxDvvDPa1IghonDmRG%2Fairsonic_new_creds.png?alt=media&#x26;token=5165e184-d0c4-4dad-92eb-0aad73266efe" alt="Filling in the required information in the &#x27;Add credentials&#x27; dialog." width="375"><figcaption></figcaption></figure></div>

4. In the **Credentials** table, next to the initial entry, select the **Delete** checkbox and click **Save**.<br>

   <div align="left"><figure><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2FUPKfeNXlCAMQTpF8Z9Y0%2Fairsonic_new_creds_remove.png?alt=media&#x26;token=20286279-a214-4b70-87aa-ca8364ea1322" alt="Deleting the default administrator login credentials."><figcaption></figcaption></figure></div>

The old default credentials are now removed and administrator access to your Airsonic instance is secured with the newly created password.

### Creating new user accounts <a href="#creating-new-user-accounts" id="creating-new-user-accounts"></a>

Using an administrator account for standard access is not recommended, especially if you plan to share the server with your peers. Airsonic allows you to create new accounts with specific permissions. This way, you can be sure that no accidental changes to the server will be done.

To create a new user:

1. Go to Airsonic **Settings** and select **Users**.
2. Make sure that **New user** is chosen next to **Select user**.
3. Select the appropriate permissions and access to media folders for the new user.
4. Enter the username, email address, and password of the new user.
5. Click **Save**.<br>

   <div align="left"><figure><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2FOFdeeUUyDCAf9KHeEzcs%2Fairsonic_user_creation.png?alt=media&#x26;token=950b37d9-e368-49db-817e-32d5f44ac8e6" alt="Clicking &#x27;Save&#x27; on the filled in new user creation screen." width="320"><figcaption></figcaption></figure></div>

The new user account is now created.

## Connect to Airsonic over Meshnet <a href="#connect-to-airsonic-over-meshnet" id="connect-to-airsonic-over-meshnet"></a>

With your Airsonic server fully set up, you can use it remotely over Meshnet.

### Method 1: Using an internet browser <a href="#method-1-using-an-internet-browser" id="method-1-using-an-internet-browser"></a>

The easiest method to access your audio files stored on the Airsonic server is using an internet browser.

1. Copy the Nord name of your Airsonic server from the NordVPN application.
2. Open your internet browser.
3. In the URL field, paste the copied Nord name followed by `:4040/` and press **Enter**.<br>

   **Example**\
   `secret.meerkat-everest.nord:4040/`<br>
4. Log in to your Airsonic account.<br>

   <div align="left"><figure><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2FhrxXpauX4GUWJfAZ3WID%2Fairsonic_connect_mesh.png?alt=media&#x26;token=3b33fa9c-0b40-47b2-8831-38e510be1340" alt="Logging in to the Airsonic web interface using the newly created user account."><figcaption></figcaption></figure></div>

Now you should have full access to your Airsonic music library while being away from home.

### Method 2: Using mobile apps <a href="#method-2-using-mobile-apps" id="method-2-using-mobile-apps"></a>

You can also use Airsonic-compatible apps to conveniently access and listen to your audio library. A list of compatible apps is available on the [Airsonic applications documentation](https://airsonic.github.io/docs/apps/) page.

{% tabs %}
{% tab title="Android" %}
To connect to your Airsonic server using the Ultrasonic app for Android:

1. Install Ultrasonic from the [Google Play Store](https://play.google.com/store/apps/details?id=org.moire.ultrasonic) and launch it.

2. In the **Welcome to Ultrasonic!** pop-up window, tap **Take me to the settings**.<br>

   <div align="left"><figure><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2FwFFG981TGrtH9Esm42w1%2Fairsonic_android_gotosettings.png?alt=media&#x26;token=bf80135d-2ff8-4b75-b4f8-0d3171dd6ab4" alt="Tapping &#x27;Take me to the settings&#x27;." width="375"><figcaption></figcaption></figure></div>

3. In the lower-right corner, tap the plus (+) button.

4. In the **Add server** screen, fill in the following information:
   * In the **Name** field, enter a custom name for your server.
   * In the **Server address** field, append the Nord name of your Airsonic server followed by `:4040`.
   * In the **Username** and **Password** fields, enter the user credentials for your Airsonic server account.\
     \
     **Example**

     <div align="left"><figure><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2F51QurWjyRmaN6MIamE9e%2Fairsonic_android_server_details.png?alt=media&#x26;token=90895a72-923a-4a6e-8b2f-1afe52629a1c" alt="Filled in details for the Meshnet Airsonic server." width="375"><figcaption></figcaption></figure></div>

5. Enable the **Force plain password authentication** toggle.<br>

   <div align="left"><figure><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2FxQyYtXtn5dMlOVzTc6Hb%2Fairsonic_android_plain_pass.png?alt=media&#x26;token=67598dc1-be1e-4c4e-849d-7293ecf94d18" alt="Enabling the &#x27;Force plain password authentication&#x27; toggle." width="375"><figcaption></figcaption></figure></div>

6. Tap **Test connection** to ensure that you can reach your server and tap **Save**.

7. From the **Configured servers** list, select your newly added server.<br>

   <div align="left"><figure><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2F9R7m8Lqa7uMjyjaGMJL4%2Fairsonic_android_select_server.png?alt=media&#x26;token=d8893ee0-34b3-417c-a7aa-501b281922c1" alt="Selecting the Meshnet Airsonic server." width="375"><figcaption></figcaption></figure></div>

Now you can navigate your music library and play selected recordings directly from the Ultrasonic app.
{% endtab %}

{% tab title="iOS" %}
To connect to your Airsonic server using the iSub app for iOS:

1. Install iSub from the [Apple App Store](https://apps.apple.com/us/app/isub-music-streamer/id362920532) and launch it.
2. In the first field, enter `http://<NordName>:4040`, replacing the Nord name with your Airsonic server’s Nord name.\
   \
   **Example**\
   `http://secret.meerkat-everest.nord:4040`<br>
3. In the **username** and **password** fields, enter authentication credentials for your Airsonic server account.
4. Tap **Save**.
5. Tap **App settings** and switch to the **Settings** tab.
6. Under **General**, turn on the **Enable basic authentication** toggle.<br>

   <div align="left"><figure><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2FclDIGnpO0NZRCXd1Re20%2Fairsonic_ios_app.png?alt=media&#x26;token=121928f0-9c17-4992-b4b9-d2d86ada18e6" alt="Turning on the &#x27;Enable basic authentication&#x27; toggle in the iSub settings." width="375"><figcaption></figcaption></figure></div>

Now you can navigate your music library and play selected recordings directly from the iSub app.
{% endtab %}
{% endtabs %}
