# Running locally `npm install && npm run build && npm start` serves the production build on port 3000. `npm run dev` works too, but cookie flags and hydration differ from production, which is why the end-to-end suite exists. Two environment values matter: `APP_SECRET` (at least 16 characters, seals stored keys — changing it makes them unreadable and the app asks for them again) and `DATA_DIR` (where `qai.db` lives, default `./data`). `.env.example` documents both plus `COOKIE_SECURE`. Model credentials are not environment configuration. They belong to each user and are pasted into the settings screen. One operational trap worth knowing: deleting the data directory while a server is running leaves that server writing into an unlinked inode. The app keeps answering and the database no longer exists anywhere. Related: [[Environment variables]], [[Container plan]], [[Gitea remote]].