Skip to main content

If you are using our backend SDK that is lesser than the following versions, please visit the older documentation link here.

MongoDB setup

important
  • This is needed only if you are running the SuperTokens core yourself.
  • We support only session management with MongoDB. Login support will be added in the future.

1) Connect SuperTokens to your database 🔌#

docker run \
-p 3567:3567 \
-e MONGODB_CONNECTION_URI="mongodb://root:root@192.168.1.2:27017/dbName" \
-d registry.supertokens.io/supertokens/supertokens-mongodb

2) Test the connection 🤞#

To test, start SuperTokens and run the following query in your database

db.key_value.find()

If you see at least one row, it means that the connection has been successfully completed! 🥳🎉

Looking for older versions of the documentation?
Which UI do you use?
Custom UI
Pre built UI