Cloud VPS from $1.98/mo · pay with Bitcoin, Ethereum, Monero, USDT or Solana · paid in crypto
DatabasesEditor's pick

MongoDB on a VPS

MongoDB Community Server stores data as flexible BSON documents, with rich queries, indexes, aggregation and replica sets, on a server you control.

1 GBMinimum memory
Ubuntu 24.04 LTSBase image
27017/tcpPorts
SSPL-1.0 (Community Server)License

About MongoDB

MongoDB stores records as BSON documents with nested fields and arrays, so a collection can hold items of different shapes. Community Server adds indexes, aggregation, transactions and replica sets, free under the Server Side Public License.

Self-hosting keeps the data in the region closest to your app. The WiredTiger cache holds the working set in RAM, so resize to a larger CloudSat plan when data outgrows memory.

mongod runs as a systemd service on port 27017 with mongosh installed. Upstream packages start with access control off and bound to 127.0.0.1.

What you get with MongoDB

  • Schema-free documents with nested fields and arrays
  • Compound, text, geospatial and TTL indexes
  • Aggregation pipeline with $lookup joins
  • Multi-document ACID transactions
  • Replica sets, sharding and change streams

MongoDB use cases

  • Back an app whose data model is still moving
  • Store catalogs, profiles or event logs with varied fields
  • Run a three-node replica set across CloudSat servers

After you deploy MongoDB

  1. When the console shows Running, SSH in as root and check systemctl status mongod.
  2. In mongosh, create an administrator in the admin database with db.createUser() and the root role.
  3. Set security.authorization: enabled in /etc/mongod.conf, then systemctl restart mongod.
  4. Before widening net.bindIp, allow 27017 only from your app servers in a CloudSat firewall and add TLS.

MongoDB ports

Open these in your firewall if you use one: 27017/tcp MongoDB (keep private).

MongoDB FAQ

Is MongoDB Community open source?

Its source is public, but the SSPL is not OSI-approved. Running it for your own apps is fine; selling MongoDB itself as a service triggers the license's source-sharing terms.

How much RAM does MongoDB need?

The default WiredTiger cache is half of RAM minus 1 GB. 1 GB suits development; give production 4 GB or more so indexes stay in memory.

Can I connect MongoDB Compass?

Yes, through a tunnel: ssh -L 27017:localhost:27017 root@<server IP>, then point Compass at localhost so the port never faces the internet.

Disclaimer. The MongoDB project has no affiliation with CloudSat and does not endorse it. Names and logos belong to their owners and appear only to identify the software.

MongoDB on your own server.
Ready in under 5 minutes.

Pick a region and a size; the console shows the address as soon as it is up.

Every server delivered in under 5 minutesPay with crypto14-day money-back