MongoDB
MongoDB is a document database designed for ease of application development and scaling.
- 1Copy the script below
- 2In HexOS, open Apps, find MongoDB and choose Custom Install
- 3Paste, then press Install — full guide with screenshots
1{
12 "version": 5,
23 "script": {
4 "version": "0.1.0",
5 "changeLog": "Auto-generated draft from TrueNAS mongodb 1.1.18"
6 },
37 "installation_questions": [
8 {
9 "question": "User",
10 "type": "text",
11 "key": "user",
12 "required": true
13 },
14 {
15 "question": "Password",
16 "type": "password",
17 "key": "password",
18 "required": true
19 },
20 {
21 "question": "Database",
22 "type": "text",
23 "key": "database",
24 "required": true
25 }
26 ],
27 "requirements": {
428 "locations": ["ApplicationsPerformance"],
529 "specifications": ["2CORE"],
630 "permissions": ["READ_WRITE_LOCATIONS"],
731 "ports": [27017]
32 },
833 "ensure_directories_exists": [
34 {"path": "$LOCATION(ApplicationsPerformance)"},
35 {"path": "$LOCATION(ApplicationsPerformance)/mongodb"},
36 {
37 "path": "$LOCATION(ApplicationsPerformance)/mongodb/data",
38 "owner": {"user": "apps"},
39 "snapshot": {"id": "data"}
40 }
41 ],
42 "app_values": {
43 "mongodb": {
944 "user": "$QUESTION(user)",
1045 "password": "$QUESTION(password)",
1146 "database": "$QUESTION(database)"
47 },
48 "storage": {
1249 "data": "$HOST_PATH($LOCATION(ApplicationsPerformance)/mongodb/data)"
50 },
51 "network": {
1352 "tcp_port": {"bind_mode": "published", "port_number": 27017}
53 },
1454 "resources": {"limits": {"cpus": 2, "memory": "$MEMORY(10%, 4096)"}}
55 }
56}
What this script does
Hover or tap a box to see the lines it explains.
-
Script format
Tells HexOS this is a version 5 install script, so it knows how to read the rest.
Line 2
-
Script revision
This copy of the script is revision 0.1.0. Latest change: “Auto-generated draft from TrueNAS mongodb 1.1.18”.
Lines 3–6
-
Questions you'll be asked
Before installing, HexOS will ask you for: User, Password and Database. Your answers are slotted into the settings further down wherever you see $QUESTION(...).
Lines 7–26
-
Storage locations it needs
The app uses these HexOS storage locations: App storage (fast). If one isn't set up yet, HexOS will ask you to pick a place for it.
Line 28
-
Minimum hardware
Recommended minimum: 2 CPU cores.
Line 29
-
Permission to use your folders
Allows the app to read and write files inside the storage locations listed above — and nowhere else.
Line 30
-
Network ports
The app needs port 27017 to be free on your server. A port is like an apartment number for your server's address.
Line 31
-
Folders created on install
Creates the folders the app needs before it starts: App storage (fast) › mongodb and App storage (fast) › mongodb › data. Some folders are handed to a specific system user so the app is allowed to write to them. Folders marked “snapshot” are included in HexOS snapshots, so you can roll them back.
Lines 33–41
-
Your answer: user
Filled in with what you typed for “user” when you installed.
Line 44
-
Your answer: password
Filled in with what you typed for “password” when you installed.
Line 45
-
Your answer: database
Filled in with what you typed for “database” when you installed.
Line 46
-
Where the app's main data is saved
Where the app's main data is saved on your server: App storage (fast) › mongodb › data.
Line 49
-
Tcp port: 27017
Publishes the app's tcp port as 27017.
Line 52
-
Resource limits
Caps how much of your server the app can use: 2 CPU cores and 10% of your server's memory, but never more than 4 GB. This keeps one busy app from slowing everything else down.
Line 54