This guide walks through installing and configuring a self-hosted remote MongoDB server for use with JetBackup 5.
By default, a standard JetBackup 5 installation creates and uses its own local MongoDB instance on the same server where JetBackup is installed. In most environments, this is the default and expected setup.
This article is intended for administrators who want to configure JetBackup 5 to use a remote MongoDB server hosted on a separate system instead of the default local MongoDB instance.
Important: When using a remote MongoDB setup, we strongly recommend installing MongoDB on a separate server from the one running JetBackup 5. If MongoDB is installed on the same server as JetBackup and JetBackup is later removed, the package removal process may also remove MongoDB and its databases. Hosting MongoDB on a separate server helps avoid accidental data loss and better aligns with the purpose of an external database deployment.
We also recommend following MongoDB’s official installation documentation for your specific operating system:https://www.mongodb.com/docs/v7.0/administration/install-on-linux/
Step 1: Install MongoDB on the Remote Server
Install MongoDB on the remote server by following MongoDB’s official installation guide:https://www.mongodb.com/docs/v7.0/administration/install-on-linux/
Follow the instructions for your operating system carefully and confirm that the mongod service is installed and running successfully.
Step 2: Configure MongoDB to Listen on the Required Interface
Edit the MongoDB configuration file:
/etc/mongod.conf
Update the network settings so MongoDB listens only on localhost and the MongoDB server interface that the JetBackup server will use to connect:
net:port: 27017bindIp: 127.0.0.1,YOUR_MONGODB_SERVER_PRIVATE_IP
If the JetBackup server connects over a private or internal network, use the MongoDB server’s private IP address on that network.
Then restart MongoDB:
systemctl restart mongod
Important: Avoid using bindIp: 0.0.0.0 unless you have a specific reason to make MongoDB listen on all interfaces and have separately restricted access through a firewall. Using 0.0.0.0 allows MongoDB to listen on all IPv4 interfaces, which increases exposure.
Step 3: Restrict Access to the JetBackup Server IP
After MongoDB is listening on the correct interface, restrict inbound access so that only the JetBackup server IP can connect to port 27017.
Firewall Restriction (Recommended)
firewalld
firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="YOUR_JB_SERVER_IP" port protocol="tcp" port="27017" accept'firewall-cmd --reload
UFW (Ubuntu or Debian)
ufw allow from YOUR_JB_SERVER_IP to any port 27017ufw deny 27017
Note: bindIp controls which local interfaces MongoDB listens on. Your firewall rules control which remote IP addresses are allowed to connect. For best security, use both.
If you also need manual access to MongoDB, for example through mongosh, you may allow your own trusted IP as well. Avoid exposing MongoDB to unrestricted public access.
Example:
firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="YOUR_IP" port protocol="tcp" port="27017" accept'firewall-cmd --reload
Step 4: Create a Database and User for JetBackup
Access the MongoDB shell:
mongosh
Then create the JetBackup database and user:
use jetbackup5db.createUser({user: "jbuser",pwd: "strongpassword",roles: [ { role: "readWrite", db: "jetbackup5" } ]})
Step 5: Configure JetBackup to Use the Remote MongoDB Server
On the JetBackup server, run the remote MongoDB installer:
jetmongo-remote-install
You will be prompted to enter the following:
- MongoDB Host, for example
192.168.1.100 - Port, default
27017 - Database Name, for example
jetbackup5 - Username, for example
jbuser - Password
If the database does not already exist, it will be created automatically during setup.
Step 6: Verify the Connection
After the configuration is complete, confirm that JetBackup is running properly and that there are no MongoDB connection errors in the logs:
tail -f /usr/local/jetapps/var/log/jetbackup5/jetbackupd.log
Notes and Recommendations
- By default, JetBackup uses a local MongoDB instance. This guide applies only when configuring JetBackup to use a remote MongoDB server.
- We strongly recommend hosting remote MongoDB on a separate server from JetBackup.
- For best security, configure MongoDB to listen only on the required interface and restrict access with a firewall.
- Only allow trusted IP addresses to access MongoDB.
- Never leave the port
27017open to unrestricted public access. - Use strong credentials for the MongoDB user.
- Keep MongoDB up to date with the latest supported patches.
- For best performance, host MongoDB in a location geographically close to the JetBackup server.
- If you experience performance issues, check for latency, packet loss, or firewall-related interruptions between the JetBackup server and the remote MongoDB server.

