# How to host a private Rocket.Chat server

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

Having your own private chat server can be beneficial, no matter who you are — a developer talking to your colleagues about the latest project, or a gamer discussing your achievements. While there are many cloud-based chat platforms, self-hosting your server gives you full control over its configuration and security.

[Rocket.Chat](https://www.rocket.chat/) is an open-source communication platform that many people choose as their server. This platform offers an extensive range of features that cater to teams of all sizes. However, making the server accessible for people outside of your [local area network](https://nordvpn.com/blog/what-is-lan/) (LAN) can be a tall order. Registering a domain name or [opening ports](https://nordvpn.com/blog/port-forwarding/) in your firewall are not tasks many individuals want to participate in.

Using Meshnet on your Rocket.Chat server device allows you to connect to the server remotely without any difficult configurations. In addition, you can share the server with your Meshnet peers and work together on [joint projects](https://nordvpn.com/meshnet/joint-projects/).

This article covers the setup procedure of a private Rocket.Chat server on desktop devices using Docker and showcases how your friends can join the server using Meshnet.

## Before you begin <a href="#before-you-begin" id="before-you-begin"></a>

Make sure that you have [Docker](https://docs.docker.com/get-started/overview/) and [Docker Compose V2](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 Rocket.Chat using Docker <a href="#deploy-rocket.chat-using-docker" id="deploy-rocket.chat-using-docker"></a>

Rocket.Chat requires two Docker containers that are dependent on each other to function. The Docker Compose tool is used to make deploying such multi-container apps easier.

### Preparing a Rocket.Chat directory <a href="#preparing-a-rocket.chat-directory" id="preparing-a-rocket.chat-directory"></a>

First, you should create a working directory for your Rocket.Chat instance. This is where all files related to the server will be stored.

{% tabs %}
{% tab title="Windows" %}
To prepare for Rocket.Chat deployment on Windows:

1. Open **PowerShell**.
2. Run the following command to create a new `rocketchat` folder and then navigate to it:\
   &#x20;

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

   &#x20;
3. Execute the following two `curl` commands to download the Rocket.Chat Docker Compose and environmental files from its [GitHub repository](https://github.com/RocketChat/Rocket.Chat):\
   &#x20;

   <pre class="language-bash" data-overflow="wrap"><code class="lang-bash">curl -o compose.yml https://raw.githubusercontent.com/RocketChat/Docker.Official.Image/master/compose.yml
   curl -Lo .env https://raw.githubusercontent.com/RocketChat/Docker.Official.Image/master/env.example
   </code></pre>

   &#x20;
4. Ensure that both files are present by running the `ls` command.

   <div align="left"><figure><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2FqZBx7hjbd3mFpBqXioV5%2Frocket_ls_win.png?alt=media&#x26;token=aac39f41-ae10-4366-bffb-dfd70dd81bdb" alt="Output of the &#x27;ls&#x27; command showing both of the downloaded files."><figcaption></figcaption></figure></div>

Both of the required files are now downloaded, and you are ready to start your Rocket.Chat server.

{% hint style="success" %}
**Tip**

You can edit the `.env` file to alter the properties of your server, such as the bind IP address or the port that the server is running on.
{% endhint %}
{% endtab %}

{% tab title="macOS and Linux" %}
To prepare for Rocket.Chat deployment on macOS and Linux:

1. Open **Terminal**.
2. Run the following command to create a new `rocketchat` and then navigate to it:\
   &#x20;

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

   &#x20;
3. Execute the following two `curl` commands to download the Rocket.Chat Docker Compose and environmental files from its [GitHub repository](https://github.com/RocketChat/Rocket.Chat):\
   &#x20;

   <pre class="language-bash" data-overflow="wrap"><code class="lang-bash">curl -LO https://raw.githubusercontent.com/RocketChat/Docker.Official.Image/master/compose.yml
   curl -Lo .env https://raw.githubusercontent.com/RocketChat/Docker.Official.Image/master/env.example
   </code></pre>

   &#x20;
4. Ensure that both files are present by running the `ls -a` command.

   <div align="left"><figure><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2FqHTzjbLuZ7nmkLJXOLYj%2Frocket_ls_linux.png?alt=media&#x26;token=85c228fc-c666-4212-9764-9ac24afcbce1" alt="Output of the &#x27;ls -a&#x27; command showing both of the downloaded files."><figcaption></figcaption></figure></div>

Both of the required files are now downloaded, and you are ready to start your Rocket.Chat server.

{% hint style="success" %}
**Tip**

You can edit the `.env` file to alter the properties of your server, such as the bind IP address or the port that the server is running on.
{% endhint %}
{% endtab %}
{% endtabs %}

### Starting Rocket.Chat <a href="#starting-rocket.chat" id="starting-rocket.chat"></a>

While in the `rocketchat` directory, execute the following command in the command line to deploy your Rocket.Chat server.

{% code overflow="wrap" %}

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

{% endcode %}

Docker will [pull the resources](https://docs.docker.com/engine/reference/commandline/pull/) required for the server and create two containers: one for the [MongoDB](https://www.mongodb.com/what-is-mongodb) database, and the other for the Rocket.Chat service.

You can use the `docker ps` command to check if both containers are active.

<div align="left"><figure><picture><source srcset="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2F1Hsveaxh8CFbqSjW2mqD%2Frocket_docker_ps_dark.png?alt=media&#x26;token=1995c9a5-7d39-4d35-8c45-72457ddecf6e" media="(prefers-color-scheme: dark)"><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2FQ3FmrIuW6nQGTcpBQkTz%2Frocket_docker_ps.png?alt=media&#x26;token=fd674fe1-7587-43e5-9362-fc0d26c25943" alt="Output of the &#x27;docker ps&#x27; command showing that both containers are active."></picture><figcaption></figcaption></figure></div>

## Set up your Rocket.Chat workspace <a href="#set-up-your-rocket.chat-workspace" id="set-up-your-rocket.chat-workspace"></a>

Now that your server is up and running, it’s time to create your Rocket.Chat workspace, including accounts and channels.

### Creating an administrator account <a href="#creating-an-administrator-account" id="creating-an-administrator-account"></a>

You can start your workspace setup process by accessing the web interface of your Rocket.Chat server.

1. Open your internet browser.
2. Navigate to the following URL:\
   `localhost:3000/`\
   &#x20;
3. On the **Admin info** page, enter the full name, username, email address, and password of the administrator account. Click **Next**.\
   &#x20;\
   **Example**

   <div align="left"><figure><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2FSxcfL9ibczLfjvcmBFn6%2Frocket_admin_info.png?alt=media&#x26;token=2bd000c3-2225-4152-b967-bef88a7cf6f1" alt="Filling in the administrator account information." width="375"><figcaption></figcaption></figure></div>

   &#x20;
4. On the **Organization info** page, fill in the required fields about your organization and click **Next**.
5. On the **Register your workspace** page, under **Admin email**, enter your email address, confirm that you agree with the **Terms and conditions** and **Privacy policy**, and then click **Register.**
6. Verify your account using the link sent to your email.

After the verification, you should be transferred to the home screen of your Rocket.Chat server.

<div align="left"><figure><picture><source srcset="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2FpQPEqPIWyo7Si7smpCXJ%2Frocket_home_screen_dark.png?alt=media&#x26;token=409f7342-9cce-4d73-9875-81ae2aa8933a" media="(prefers-color-scheme: dark)"><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2FZhMMoYT4Fypr3neziAJu%2Frocket_home_screen.png?alt=media&#x26;token=22ba77ce-65cb-4392-a051-83a6f7e87e03" alt="Rocket.Chat server&#x27;s home screen."></picture><figcaption></figcaption></figure></div>

### Adding new users <a href="#adding-new-users" id="adding-new-users"></a>

Now that the server is fully active and you have an administrator account configured, you can add new user accounts for your friends.

1. On the Rocket.Chat home page, click **Add users**.

   <div align="left"><figure><picture><source srcset="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2FUVZP0OS2kxaEKyVnJABT%2Frocket_add_users_dark.png?alt=media&#x26;token=7d49ffb6-722d-40a2-97e0-d37008305c35" media="(prefers-color-scheme: dark)"><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2F4Zf35WzHU3GEqi36rs0M%2Frocket_add_users.png?alt=media&#x26;token=7e5446ff-911a-4943-9eaf-f46d2ec4bf72" alt="Arrow pointing to a highlighted &#x22;Add users&#x22; button." width="563"></picture><figcaption></figcaption></figure></div>

   &#x20;
2. In the upper-right corner, select **New user**.

   <div align="left"><figure><picture><source srcset="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2Ffwj7JbmXJ2He2O8auVyk%2Frocket_new_user_dark.png?alt=media&#x26;token=7856feb9-b639-4d96-b7f6-f83e16d9b507" media="(prefers-color-scheme: dark)"><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2Fahu6A38IrxiNJ5pchMjl%2Frocket_new_user.png?alt=media&#x26;token=1f3763f3-f0ce-4b5c-933a-11b7628543c1" alt="&#x22;New user&#x22; button highlighted." width="563"></picture><figcaption></figcaption></figure></div>

   &#x20;
3. Fill in the details for the new user account.
4. Click **Save**.

You should now see an entry for the new user on the **Users** page.

<div align="left"><figure><picture><source srcset="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2Fs6alOhj2M4tj0ptO3H6Y%2Frocket_users_table_dark.png?alt=media&#x26;token=786dae94-b053-4da2-88cc-780d87c26ef6" media="(prefers-color-scheme: dark)"><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2FWfkuCcvOb6clQvIi0MEQ%2Frocket_users_table.png?alt=media&#x26;token=5dd75f91-1f30-44b3-bd0c-d9f4a85d04b9" alt="Information of the new user account on the &#x27;Users&#x27; page."></picture><figcaption></figcaption></figure></div>

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

You also can create various new channels for specific purposes. To create a new channel:

1. On the Rocket.Chat home page, click **Create channel**.
2. Fill in the details for your new channel and select the members you want to include.
3. Click **Create**.

   <div align="left"><figure><picture><source srcset="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2FpBMIpkLwMWEKnShMAy4p%2Frocket_create_channel_dark.png?alt=media&#x26;token=47b84c72-6f89-42bd-a0ca-2da5ec56c477" media="(prefers-color-scheme: dark)"><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2FuJljJxb8JnR6EF7auSPr%2Frocket_create_channel.png?alt=media&#x26;token=38066696-6942-4711-b9d4-56c97336b425" alt="Clicking &#x27;Create&#x27; in the configured channel creation menu." width="375"></picture><figcaption></figcaption></figure></div>

The new channel should now be visible in the **Channels** list on the left.

<div align="left"><figure><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2FKji1ZEl6ZeJ6XvyBacEK%2Frocket_channel_list.png?alt=media&#x26;token=857a3206-8f93-4eec-a000-eacb4d720a97" alt="New channel visible in the &#x27;Channels&#x27; list." width="331"><figcaption></figcaption></figure></div>

### Disabling the two-factor authentication requirement <a href="#disabling-the-two-factor-authentication-requirement" id="disabling-the-two-factor-authentication-requirement"></a>

By default, Rocket.Chat requires email two-factor authentication for each new user. However, without setting up an [SMTP](https://en.wikipedia.org/wiki/Simple_Mail_Transfer_Protocol) server, the emails are not sent and the users are unable to log in. Since your server is not public and only accessible by your Meshnet peers, you can disable the two-factor authentication requirement entirely.

1. On your Rocket.Chat home page, in the upper-left corner, select the three-dot menu and choose **Workspace**.

   <div align="left"><figure><picture><source srcset="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2FOlfxM22pQWO6Uewph5LT%2Frocket_workspace_dark.png?alt=media&#x26;token=10b297f0-e661-4dad-aa2d-d99845700529" media="(prefers-color-scheme: dark)"><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2FtsEqB0FK51I0rXCUsWeZ%2Frocket_workspace.png?alt=media&#x26;token=0a3d65a1-95f4-45ab-af20-596ab6db7040" alt="Navigating to the &#x27;Workspace&#x27; option using the three-dot menu." width="375"></picture><figcaption></figcaption></figure></div>

   &#x20;
2. From the list on the left, select **Settings**.
3. Under **Accounts**, click **Open**.
4. Expand the **Two factor authentication** section.
5. Turn off the **Enable two factor authentication** toggle.

   <div align="left"><figure><picture><source srcset="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2FWSUs2Killlz9cMNg57ov%2Frocket_2fa_dark.png?alt=media&#x26;token=46441c36-815b-48b4-a18b-76325b91752c" media="(prefers-color-scheme: dark)"><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2Fvewqu084i6D5wTrAcrvO%2Frocket_2fa.png?alt=media&#x26;token=ee833f45-b11c-4375-957d-74809014196f" alt="Turning off the &#x27;Enable two factor authentication&#x27; toggle." width="563"></picture><figcaption></figcaption></figure></div>

   &#x20;
6. In the lower-right corner, click **Save changes**.

Two-factor authentication is now disabled for all users, and you won’t be required to confirm your identity via email when you log in to your Rocket.Chat server.

## Connect to your Rocket.Chat server <a href="#connect-to-your-rocket.chat-server" id="connect-to-your-rocket.chat-server"></a>

Now that your server is fully functional, you can invite your friends to connect over Meshnet using one of the following methods.

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

If you're hosting Rocket.Chat on a Linux device, you must grant the [local network permission](https://meshnet.nordvpn.com/features/explaining-permissions/local-network-permissions) for the devices accessing it. For more information, see [Common issues on Linux](https://meshnet.nordvpn.com/troubleshooting/linux#cannot-access-docker-containers-over-meshnet).
{% endhint %}

### Method 1: Using the Rocket.Chat client app <a href="#method-1-using-the-rocket.chat-client-app" id="method-1-using-the-rocket.chat-client-app"></a>

On desktop devices, you can connect to the Rocket.Chat server using Rocket.Chat’s client app.

1. Download and install the Rocket.Chat desktop app.
   * You can download the Rocket.Chat installer for Windows from the [Rocket.Chat website](https://www.rocket.chat/install#Apps).
   * You can download the [Rocket.Chat app for macOS](https://apps.apple.com/us/app/rocket-chat/id1086818840) from the Mac App Store.
   * You can download the [Rocket.Chat app for Linux](https://snapcraft.io/rocketchat-desktop) from the Snap store
2. Open **Rocket.Chat**.
3. For the server URL, enter `http://<NordName>:3000`, replacing `<NordName>` with your Rocket.Chat server’s Nord name. Click **Connect**.\
   &#x20;

   **Example**

   <div align="left"><figure><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2FXtPjUWgjMP39Xi3irVgE%2Frocket_app_url.png?alt=media&#x26;token=676d005e-cd8c-401c-9776-0b3dfcc81e1c" alt="Entering the server address and clicking connect in the Rocket.Chat client app." width="375"><figcaption></figcaption></figure></div>

   &#x20;
4. Log in to your Rocket.Chat account.

Now you can conveniently use your Rocket.Chat server from the app.

<div align="left"><figure><picture><source srcset="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2FfHNJnTPtylTUalxb61Na%2Frocket_app_chat_dark.png?alt=media&#x26;token=c8480fda-885b-4a72-85e4-4d6cb8e15dbd" media="(prefers-color-scheme: dark)"><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2FHiB2Fn3lOQSFHsF0lVGS%2Frocket_app_chat.png?alt=media&#x26;token=0a469f94-d8dc-4dbd-a0c7-c27b425a441b" alt="Channel opened in the Rocket.Chat client app."></picture><figcaption></figcaption></figure></div>

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

Rocket.Chat mobile apps do not allow HTTP-only connections. Without setting up [SSL certificates](https://nordvpn.com/blog/what-is-ssl/), you won’t be able to connect to your Rocket.Chat server using the mobile apps.
{% endhint %}

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

In some cases, installing additional software on the client devices may not be convenient or permitted. In such scenarios, you can access the Rocket.Chat server using an internet browser.

1. Copy the Nord name of your Rocket.Chat server from the NordVPN application.
2. Open your internet browser.
3. In the URL field, paste the copied Nord name followed by `:3000/` and press **Enter**.\
   &#x20;\
   **Example**\
   `secret.meerkat-everest.nord:3000/`\
   &#x20;
4. Log in to your Rocket.Chat account.

You can now communicate with other members of your Rocket.Chat server from the convenience of your internet browser on any device.

<div align="left"><figure><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2FUwZlepjoeCoiWttY3H7d%2Frocket_mobile.png?alt=media&#x26;token=f881c640-4725-4e5e-b4c8-5964f048e29d" alt="A channel in the Rocket.Chat server accessed using an internet browser on a mobile phone." width="375"><figcaption></figcaption></figure></div>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://meshnet.nordvpn.com/how-to/joint-projects/private-rocket.chat-server.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
