MongoDB 8
MongoDB Server is a general purpose, document-based, distributed database built for modern application developers and for the cloud era.
Ports
Add an allocation on the node for each port.
- Server 27017
Install
- Installer image
- mongo:8-noble
- Install script
- 21 lines
Image
- MongoDB_8 ghcr.io/ptero-eggs/yolks:mongodb_8
Startup
The Panel runs this command to start the server. It replaces each variable in the command with the value of that variable.
2 variables
Startup command
mongod --fork --dbpath /home/container/mongodb/ --port 27017 --bind_ip 0.0.0.0 --logpath /home/container/logs/mongo.log -f /home/container/mongod.conf; until nc -z -v -w5 127.0.0.1 27017; do echo 'Waiting for mongodb connection...'; sleep 5; done; mongosh --username admin --password {{MONGO_USER_PASS}} --host 127.0.0.1:27017 && mongosh --username admin --password {{MONGO_USER_PASS}} --host 127.0.0.1:27017 --eval "db.getSiblingDB('admin').shutdownServer()"Dotted values come from the server settings. These values are examples.
The MongoDB Admin user
MONGO_USERUsers can edit
required|string
MONGO_USER_PASSUsers can edit
required|stringA value is required.
Wings
- Stop command
- exit
- Running when the console shows
- child process started successfully
Files Wings edits
Wings sets these values in these files before each start.
mongod.conf file
- #security:
- security: authorization: "enabled"
Readme
MongoDB
From their Website
MongoDB is a general purpose, document-based, distributed database built for modern application developers and for the cloud era.
MongoDB free monitoring.
To disable the message about free monitoring you can run db.disableFreeMonitoring().
Security
MongoDB 6+ eggs enable access control by default in the mongod.conf file, meaning that even if people will be able to connect to your database as guests, they will not be able to perform any operation, apart from nonhazardous commands
Disabling authentication
If you know what you are doing and want to explicitly disable access control, you can edit the following lines to your mongod.conf file:
security:
authorization: "disabled"
Minimum RAM warning
MongoDB requires approximately 1GB of RAM per 100,000 assets. If the system has to start swapping memory to disk, this will have a severely negative impact on performance, and should be avoided.
Server Ports
Ports required to run the server in a table format.
| Port | default |
|---|---|
| Server | 27017 |
Changes
- Add: MongoDB 8
· Daniel Barton · c1aab3f
- Add database eggs
· Daniel Barton · da2fc87
Problem with this egg?
Open an issue on GitHub. Include your Panel and Wings versions.
Install script 21 lines bash in mongo:8-noble Show Hide
#!/bin/bash
if [ ! -d /mnt/server/ ]; then
mkdir -p /mnt/server/
fi
cd /mnt/server/
cp /etc/mongod.conf.orig /mnt/server/mongod.conf
mkdir mongodb logs
mongod --port 27017 --dbpath /mnt/server/mongodb/ --logpath /mnt/server/logs/mongo.log --fork
mongosh --eval "db.getSiblingDB('admin').createUser({user: '${MONGO_USER}', pwd: '${MONGO_USER_PASS}', roles: ['root']})"
mongosh --eval "db.getSiblingDB('admin').shutdownServer()"
## install end
echo "-----------------------------------------"
echo "Installation completed..."
echo "-----------------------------------------"