nodemon Runtime
Host Node.js apps with automatic restart on file change using nodemon on Witchly.host. Ideal for rapid iteration and development.
languages (12 articles)
On This Page
nodemon Runtime
The nodemon egg runs Node.js 24.x wrapped in nodemon — a utility that watches your files and restarts your app whenever you save changes. This is the same Node.js runtime, but with auto-reload built in.
When to use nodemon vs plain Node.js
- Use nodemon when you’re actively developing — edit a file via SFTP or the File Manager, save, and your app restarts automatically.
- Use plain Node.js for production — no unnecessary restart churn, saves a small amount of RAM.
Quick deploy
- dash.witchly.host → Deploy → Languages → nodemon.
- On the Startup tab, set:
Git Repo Address— your repo URLBot js file— entrypoint (defaultindex.js)
- Start.
Startup flow
npm install nodemon
# Pull latest if AUTO_UPDATE=1
if [[ -d .git ]] && [[ {{AUTO_UPDATE}} == "1" ]]; then git pull; fi
# Install any extra packages
if [[ ! -z ${NODE_PACKAGES} ]]; then /usr/local/bin/npm install ${NODE_PACKAGES}; fi
# Run via nodemon — watches the filesystem and reloads on change
./node_modules/.bin/nodemon ${BOT_JS_FILE}
Variables reference
| Variable | Purpose |
|---|---|
GIT_ADDRESS | Git repo URL |
BRANCH | Git branch |
USER_UPLOAD | 1 to upload via SFTP instead of cloning |
AUTO_UPDATE | 1 to git pull on each start |
BOT_JS_FILE | Entrypoint (default index.js) |
NODE_PACKAGES | Extra npm packages to install |
UNNODE_PACKAGES | Packages to uninstall |
USERNAME, ACCESS_TOKEN | Private repo credentials |
How file-watching works
nodemon watches /home/container and restarts your process when any .js, .mjs, .json, or .ts file changes. You can customize this with a nodemon.json in your repo:
{
"watch": ["src"],
"ext": "js,ts,json",
"ignore": ["node_modules", "logs"],
"delay": 1000
}
The delay (ms) debounces rapid saves so nodemon doesn’t restart 5 times during a long save.
Typical workflow
- Connect via SFTP.
- Open your editor (VS Code + SFTP extension, or sshfs-mount the server).
- Edit a file, save — nodemon restarts automatically.
- Watch the console for errors.
Troubleshooting
- Restart loop — your app is throwing on startup. Fix the error; nodemon will stop restarting once the crash stops.
- Changes not detected — make sure you’re editing files inside
/home/container, not a stale local copy; nodemon won’t pick up changes on the client side. - “command not found: nodemon” — happens if
npm install nodemonfailed on boot; run it manually from the Console tab.
Next steps
- Promote to production with the plain Node.js runtime
- Use Git webhooks to auto-deploy on push (combine with
AUTO_UPDATE)