What’s a simple development setup for React, Node, and databases on CachyOS?
Asked by
crescendo~
I'm new to development on CachyOS and would appreciate advice on setting up a reliable environment on a frequently updated operating system. I already have Node.js installed and plan to work with React, Node.js, Express, and PostgreSQL or MariaDB. Should I install Node.js inside Docker, or is it better to keep it on the host? I'd like to avoid unnecessary complexity while still keeping the project's versions and database setup manageable.
Answers
For this stack, I’d keep Node.js and the React/Express tools on the host for now, then use a version manager such as fnm, nvm, or asdf. Pin the project’s Node version with an .nvmrc or tool-versions file so system updates don’t make the project depend on whatever version happens to be installed. Use Docker Compose for PostgreSQL or MariaDB, since containers make databases easy to recreate, reset, and keep separate from the host system.
Reply to this answer
Dockerizing Node.js is possible, but it can add extra friction with file watching, permissions, dependency volumes, and debugging. Since you’re still learning, keeping Node on CachyOS will probably make development easier. You can move it into a container later if you need a fully isolated or reproducible environment.
Reply to this answer
Another approach is using Nix with devenv to define the development environment declaratively. That can provide strong reproducibility, but it has its own learning curve. For a straightforward setup, a host-installed Node version manager plus a Dockerized database is likely the simplest place to start.
Reply to this answer
Add your answer
Answers are reviewed before publication.
Related Discussions