Deploy with Digital Ocean

The recommended deployment methods are Docker, AWS, and Kubernetes.

Rocket.Chat offers a seamless and user-friendly deployment solution on Digital Ocean with the 1-Click install from the Digital Ocean marketplace. Follow the steps in this document to install Rocket.Chat using Digital Ocean.

Preparation steps

Before you begin, make sure you have the following:

  • An active Digital Ocean account.

  • A domain name (optional). You can use Digital Ocean's provided IP address, but it is recommended that you have a domain name for production setup. For example, chat.mycompany.com.

    • With this setup, HTTPS will be available using Let's Encrypt certificates.

Step 1: Create a Rocket.Chat droplet

Make sure that you are logged into your Digital Ocean account and follow these steps:

  1. Go to the Rocket.Chat app on the Digital Ocean marketplace.

  2. Click Create Rocket.Chat Droplet.

  3. A new tab opens with the Create Droplets page, where we configure the droplet. For further details, refer to the How to Create a Droplet guide.

  4. Choose the region and the data center for the droplet according to your needs.

  5. In the Choose an image section, the Rocket.Chat image is selected automatically, so you don’t need to do anything here.

  6. In the Choose size section, select the CPU and storage options according to your needs.

  7. (Optional) You can add more storage or enable automated backups of the droplet.

  8. In the Choose Authentication Method section, select how you want to log in to the droplet.

  9. In the Finalize Details section, you can add droplets with the same configuration, provide a hostname to the droplet (or the default one is used), add tags, and select the project.

  10. Once you have selected the options, click Create Droplet.

Give it a few minutes, and your droplet should be created successfully. You can view the droplet details, such as the IP address. Now, create a registered domain name if you don’t have one and set up an A record from your domain (for example, chat.mycompany.com) to the droplet's IP address. You'll need the domain to enable HTTPS on your workspace. If you are deploying for testing purposes and do not need a domain name, you can directly proceed to the next step.

Step 2: Connect to the Rocket.Chat droplet

Once the droplet is set up, you can log in and access your Rocket.Chat workspace. Follow these steps to do so:

  1. Click the droplet to access the droplet view page.

  2. Click Console to launch the droplet as a root user. Alternatively, use the command ssh root@your_droplet_ip.

  3. Once connected, you will see a message as follows:

##################################################################################################################################################################
Rocket.Chat is the leading open source team chat software solution. Free, unlimited and completely customizable with on-premises and SaaS cloud hosting.
Replace email, HipChat & Slack with the ultimate team chat software solution.

This Rocket.Chat image uses docker under the hood. To learn more, please read our docker documentation - https://docs.rocket.chat/deploy/prepare-for-your-deployment/rapid-deployment-methods/docker-and-docker-compose

You can find the compose project in $HOME/rocketchat directory.

Looking for how to use Rocket.Chat? Be sure to check our docs: https://docs.rocket.chat
Need some help? Join our community forums https://forums.rocket.chat and https://open.rocket.chat
##################################################################################################################################################################

Now you can access your Rocket.Chat workspace by visiting http://<droplet-ip>:3000. The first user needs to create an account using the setup wizard, and this user will be automatically set as the workspace administrator.

The Digital Ocean deployment solution is a one-click installation of the server with the Docker deployment of Rocket.Chat. See deploy with Docker & Docker Compose to learn how to manage your Rocket.Chat Docker deployment.

Next steps

Great! You’ve successfully created your Rocket.Chat workspace and logged in. Next, check out the following documents to get started:

  • User Guides: Learn the basics of your Rocket.Chat account, the types of rooms, and how to communicate with your workspace users.

  • Workspace Administration: Administrators and owners can set and manage various configurations.

  • Marketplace: Explore the available apps to enhance your workspace.

You can also apply the following additional configuration to your Rocket.Chat setup for enhanced security and performance:

Enable HTTPS for your Rocket.Chat workspace using Nginx

For your workspace’s security, your domain should be accessible only via HTTPS. While there are various ways to set up a reverse proxy, this section provides a walkthrough on using Nginx.

Configure your domain or subdomain

To make your Rocket.Chat instance accessible via a custom domain or subdomain (e.g., chat.mycompany.com), you need to create a DNS record with your domain provider (e.g., AWS Route 53, Namecheap, GoDaddy, Cloudflare, etc.). To achieve this, follow these steps:

  1. Log in to your domain registrar or DNS hosting provider

  2. Go to the DNS management section for your domain

  3. Create an A record pointing to your DigitalOcean droplet’s IP address:

    1. Type: A

    2. Host/Name: chat (if using a subdomain like chat.mycompany.com) or @ (if using the root domain like mycompany.com)

    3. Value: Your DigitalOcean droplet’s public IPv4 address

    4. TTL: Default (e.g., 300 seconds)

  4. Save the record

To verify that the domain is resolving correctly, run:

nslookup chat.mycompany.com
## or
dig +short chat.mycompany.com

The setup is correct if either of these commands returns your droplet’s IP address.

Install Nginx and Certbot on your droplet

Click Access, log in as root, and launch the droplet. Alternatively, use the command ssh root@your_droplet_ip. Then follow these steps:

  1. Install Nginx

    sudo apt update && sudo apt install nginx -y
  2. Install Certbot (for Let's Encrypt SSL)

    sudo apt install certbot python3-certbot-nginx -y

Configure Nginx for your domain

  1. Create an Nginx configuration file:

    sudo nano /etc/nginx/sites-available/chat.mycompany.com

    Replace chat.mycompany.com with the appropriate domain name.

  2. Add:

    server {
        listen 80;
        server_name <your-domain>;
    
        location / {
            proxy_pass http://localhost:3000;  # Change this if Rocket.Chat runs on a different port
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto $scheme;
        }
    }

    Save and exit.

  3. Enable the site and reload Nginx:

    sudo ln -s /etc/nginx/sites-available/chat.mycompany.com /etc/nginx/sites-enabled/
    sudo nginx -t
    sudo systemctl reload nginx

    Replace chat.mycompany.com with the appropriate domain name.

Obtain an SSL certificate

  1. Run:

    sudo certbot --nginx -d <your-domain>

    Certbot will:

    1. Obtain an SSL certificate from Let's Encrypt

    2. Automatically configure Nginx to use HTTPS

  2. Verify renewal:

    sudo certbot renew --dry-run

Test your HTTPS setup

Visit https://<your-domain> in your browser. If everything is set up correctly, your Rocket.Chat workspace will now be secured with HTTPS.

Monitor and log your deployment

Effective logging helps you monitor the health and status of your Rocket.Chat deployment. This section covers logging for Rocket.Chat, MongoDB, and reverse proxies like Traefik or Nginx.

Rocket.Chat logs

To check the status and logs of your Rocket.Chat container, follow these steps:

  1. Use any of the following commands to list containers running in your Docker environment:

    docker ps        # Shows currently running containers with details like ID, status, and ports  
    docker ps -a     # Lists all containers, including stopped ones  
    docker ps -q     # Displays only container IDs for a concise view  
    docker compose ps  # Lists services managed by Docker Compose  
  2. Once you identify your Rocket.Chat container, you can inspect its logs using any of these commands:

    docker compose logs -f <Service_Name>  # If using Docker Compose, this follows real-time logs  
    docker logs <Container_Name>       # Displays logs for the specific Rocket.Chat container  
    docker logs -f <Container_Name>    # Shows real-time logs (follow mode)  
    docker logs --tail 10 <Container_Name> # Displays the last 10 lines of logs  

Note:

  • Replace <Container_Name> and <Service_Name> with the appropriate values such as docker compose logs -f rocketchat.

  • Rocket.Chat logs to stdout, so there isn't a specific log file within the container. The Docker logging system captures these stdout logs, making them accessible through the docker logs command

MongoDB logs

MongoDB is a crucial part of your Rocket.Chat deployment. Monitoring its logs can help identify database-related issues.

  1. View MongoDB logs by running any of these commands:

    docker logs -f <MongoDB_Container_Name>  # View real-time logs  
    docker logs --tail 20 <MongoDB_Container_Name>  # Show the last 20 log lines  
    docker compose logs -f mongodb  # If using Docker Compose  
  2. To inspect MongoDB’s health, run:

    docker exec -it <MongoDB_Container_Name> mongosh --eval "db.runCommand({ serverStatus: 1 })"

    This returns detailed server status information.

Replace <Container_Name> with the appropriate values.

Nginx logs

  • Check error logs:

    sudo tail -n 50 /var/log/nginx/error.log
  • Check access logs:

    sudo tail -n 50 /var/log/nginx/access.log
  • Monitor logs in real-time:

    sudo tail -f /var/log/nginx/error.log
  • Check if Nginx is running:

    sudo systemctl status nginx
  • Test the Nginx configuration:

    sudo nginx -t
  • If there are configuration issues, restart Nginx after fixing them:

    sudo systemctl restart nginx

Visit the accessing your workspace guide to configure your workspace and onboard other team members.

Update your workspace version

It’s important to keep your workspaces updated to enjoy the benefits of new features and fixes. Since DigitalOcean runs Rocket.Chat using Docker, the update process is similar to a standard Docker deployment.

Follow these steps to update your workspace version:

  1. Navigate to the rocketchat directory and edit the .env file:

    cd rocketchat
    nano .env

  2. Set the RELEASE variable to your prefered Rocket.Chat version:

    RELEASE=<desired version>

    Refer to the official releases for available versions.

  3. Now, remove and restart your rocketchat container to update the workspace:

    docker compose down rocketchat
    docker compose up -d rocketchat

If you have any questions or issues when updating Rocket.Chat, refer to Guidelines for updating Rocket.Chat and Updating Rocket.Chat FAQ.