# PBM with two instances

**URL:** <https://forums.percona.com/t/pbm-with-two-instances/24971>\
**Category:** Percona Backup for MongoDB\
**Tags:** community\
**Created:** [September 5, 2023, 7:58pm UTC](https://forums.percona.com/t/pbm-with-two-instances/24971 "2023-09-05T19:58:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Samir\_Naves](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/samir_naves/32/8917_2.png) [@Samir\_Naves](https://forums.percona.com/u/Samir_Naves)\
**Post date:** [September 5, 2023, 7:58pm UTC](https://forums.percona.com/t/pbm-with-two-instances/24971/1 "2023-09-05T19:58:02Z")

</div>

Hello, I have two mongodb database instances on the same server. Ports 21017 and 21018.  
How do I configure pbm to backup to S3?

---

<div class="post-metadata">

**Author:** ![anil.joshi](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/anil.joshi/32/13100_2.png) [@anil.joshi](https://forums.percona.com/u/anil.joshi)\
**Post date:** [November 13, 2023, 10:02am UTC](https://forums.percona.com/t/pbm-with-two-instances/24971/2 "2023-11-13T10:02:12Z")

</div>

Hello Samir,

> I have two mongodb database instances on the same server. Ports 21017 and 21018.  
> How do I configure pbm to backup to S3?

You can refer to the remote backup configuration section:- [Set up and configure - Percona Backup for MongoDB](https://docs.percona.com/percona-backup-mongodb/install/initial-setup.html#configure-remote-backup-storage) for taking backups in S3 OR S3 compatible systems such as Google cloud storage (Bucket) etc.

For a complete setup guide of PBM in Mongo ReplicaSet/Shard environment you can refer to the below manual.

> **[Percona Backup for MongoDB - Set up and configure](https://docs.percona.com/percona-backup-mongodb/install/initial-setup.html)**
>
> After you install Percona Backup for MongoDB on every server with the mongod node that is not an arbiter node, the setup steps are the following:

Let us know if you still having any further concerns!

Regards,  
Anil

---

<div class="post-metadata">

**Author:** ![Ivan\_Groenewold](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/ivan_groenewold/32/6299_2.png) [@Ivan\_Groenewold](https://forums.percona.com/u/Ivan_Groenewold)\
**Post date:** [November 15, 2023, 5:43pm UTC](https://forums.percona.com/t/pbm-with-two-instances/24971/3 "2023-11-15T17:43:28Z")

</div>

You will need a dedicated pbm-agent for each mongod process running. You can clone the existing systemd service and change the configuration to deploy a 2nd service. Doc linked above should be helpful
