Troubleshooting
The errors you can meet while installing the dashboard, what causes each one, and how to fix it.
For the Full Stack package
Docker is not running
failed to connect to the docker API at unix:///…/docker.sock; check if the path is correct and if the daemon is runningOlder Docker versions say "Cannot connect to the Docker daemon" instead. Either way, the Docker engine is not started.
Open Docker Desktop
Start Docker Desktop and wait until it reports that the engine is running. On Linux, start the service:
sudo systemctl start docker.Check that Docker answers
Terminaldocker infoExpected result: It prints a Server section instead of an error.
Run your start command again
docker compose up --buildfor the Full Stack, or yourdocker buildanddocker runfor the Admin Dashboard package.
A port is already in use
ports are not available: exposing port TCP 0.0.0.0:3030 … bind: address already in use
Bind for 0.0.0.0:3030 failed: port is already allocated
Error: listen EADDRINUSE: address already in use :::3030The first two lines come from Docker, the last from yarn dev or yarn start. Another program already listens on 3030 or 8000: often an earlier run of the dashboard, or another project's dev server.
Find what holds the port
On macOS or Linux, with the port from the message:
Terminallsof -i :3030On Windows, in PowerShell:
Terminalnetstat -ano | findstr :3030Stop it
Close that program, or stop the earlier run: Ctrl+C in its terminal,
docker compose downin its folder, ordocker stopfor a container you started withdocker run. Then start the dashboard again.Or run the dashboard on other ports
With the Full Stack in Docker, create a file named
.envin thedashboard-2-full-stackfolder, besidedocker-compose.yml, with the port you need.DASHBOARD_PORTmoves the dashboard andAPI_PORTthe API; the addresses the apps use,CORS_ORIGINincluded, follow by themselves.dashboard-2-full-stack/.envDASHBOARD_PORT=3040Then run the same command again. A failed start picks up where it stopped:
Terminalindashboard-2-full-stackdocker compose up --buildExpected result: The dashboard answers on its new port, here localhost:3040Local.
- Admin Dashboard package in Docker: change the number on the left of
-p, for exampledocker run -p 3040:3030 dashboard-2, and open localhost:3040Local. The app inside the container always listens on 3030. - Without Docker: set
PORT=3040in the dashboard's.env(create the file with just that line if you have none), or runPORT=3040 yarn devon macOS and Linux. With an API, add the new address to the API'sCORS_ORIGINandFRONTEND_URLtoo. - The API without Docker: change
PORTinback-end/.env, andNEXT_PUBLIC_API_BASE_URLandNEXT_PUBLIC_WEBSOCKET_BASE_URLin the dashboard's.env, together.
The Docker build fails
The first build downloads the base images, every dependency and the dashboard's Arabic font from Google Fonts, then builds the images. It stops with "failed to solve" and the step that failed when something gets in the way.
- No connection or a timeout: the build needs internet access. Run the command again once you are online; finished steps are cached.
- No space left on device: free space in Docker Desktop, or check what Docker uses with
docker system df. - It fails at the same step every time: rebuild without the cache, then start.
dashboard-2-full-stackdocker compose build --no-cache
docker compose upFor the Admin Dashboard package, add --no-cache to your docker build command.
A first start that seems stuck is usually still seeding the sample data. The dashboard starts only once the API reports itself healthy, which can take up to a minute.
Yarn says its version is 1.22
This project's package.json defines "packageManager": "yarn@4.8.1…". However the current global version of Yarn is 1.22…Each app pins Yarn 4 through Corepack. This message means Corepack is not enabled yet, so the old global Yarn answered instead.
corepack enableThen run yarn install again. If your Node.js has no Corepack (Node.js 25 and newer), install it first with npm install -g corepack.
The dashboard does not start on an older Node.js
node: bad option: --env-file-if-exists=.envThe dashboard's yarn dev and yarn start read .env with an option Node.js added in version 22.9. Check yours:
node -vIf it prints a version below 22.9, install Node.js 22.9 or newer, run corepack enable again, delete the app's node_modules folder and run yarn install again. With Docker none of this applies: the images bring their own Node.js.
The API stops before starting
The API cannot start: JWT_SECRET is not set. Set it in back-end/.env to the output of: …
The API cannot start: JWT_SECRET is still the example value from .env.example, so anyone can sign a token for any account. …
The API cannot start: CORS_ORIGIN is not set. List the dashboard origin (comma separated if there are several), …The API checks its settings before it starts and prints one line per problem. The causes:
- There is no `.env` file, or `JWT_SECRET` is empty. Create the file in
back-endwithcp .env.example .env. - `JWT_SECRET` is still the example value with `NODE_ENV=production`. Anyone could sign a token with the public example, so a production start refuses it. Generate your own secret.
- `CORS_ORIGIN` is empty with `NODE_ENV=production`. Set it to the dashboard's address.
Generate a secret with:
node -e "console.log(require('crypto').randomBytes(48).toString('hex'))"With Docker you do not need one: a container without a JWT_SECRET of its own, or with the example one, generates a secret and keeps it in the data volume.
Sign-in fails
- Check the account. The Super Admin is
admin@example.comwithAdmin@123; the other sample admins useadmin123. - "That email and password combination didn't work. Please try again." answers a wrong password and an unknown email alike, and also a database with no accounts. Without Docker, run
yarn seedinback-end:yarn devcreates the tables by itself, but only the seed adds the accounts. - "Too many failed sign-in attempts. Wait 15 minutes, then try again." One address failed
RATE_LIMIT_LOGINsign-ins (10 by default) within 15 minutes. Wait, or restart the API: the count is kept in its memory. - The sign-in page never answers. The dashboard cannot reach the API: see the next problem.
- You changed the Super Admin's password and no longer have it: start over with fresh sample data, below.
Sign-in fails
- On the mock API, sign in with
admin@example.comandAdmin@123, or a sample Viewer such asjohn.smith@admin.comwithadmin123. These accounts live in your browser: a password you changed there stays changed until you clear the site's data. - On your own API, the account has to exist there. On this template's API, the seed adds the same accounts. If no account works, the dashboard may not reach the API: see the next problem.
Pages stay empty and the browser reports CORS
Access to XMLHttpRequest at 'http://localhost:8000/api/auth/login' from origin 'http://localhost:3040' has been blocked by CORS policyThe browser's console shows this line when the dashboard runs on an address the API does not accept. The API answers browsers only from the addresses in CORS_ORIGIN, which defaults to http://localhost:3030.
CORS_ORIGIN=http://localhost:3040
FRONTEND_URL=http://localhost:3040- Write each address exactly as the browser shows it, with the scheme and the port and without a trailing slash, comma separated if there are several. Then restart the API.
FRONTEND_URLis the one address the live permission updates accept. Move it with the dashboard.- With the Full Stack in Docker you do not edit these:
DASHBOARD_PORTandDASHBOARD_URLin the.envbesidedocker-compose.ymlset them. - A dashboard that cannot reach the API at all, because it is stopped or at another address, fails the same way without the CORS line. Check that localhost:8000/
api/ healthLocal answers, and that the dashboard's NEXT_PUBLIC_API_BASE_URLnames that API.
The dashboard shows sample data instead of my API
Sample data
No API is connected (NEXT_PUBLIC_API_BASE_URL is empty), so the dashboard runs on built-in sample data. …The dashboard was built without an API address, so it runs on its built-in mock API. That happens without a .env file, with NEXT_PUBLIC_API_BASE_URL= empty, or with a Docker image built without the --build-arg.
- Without Docker:
cp .env.example .envin the dashboard's folder, checkNEXT_PUBLIC_API_BASE_URL, then restartyarn dev, or runyarn buildagain for a production build. - Docker, Admin Dashboard package: build the image again with
--build-arg NEXT_PUBLIC_API_BASE_URL=…, as in the installation guide. - Docker Compose: the compose file always builds the dashboard with the API's address, so this notice does not appear there.
A change to the dashboard's .env does nothing
Every NEXT_PUBLIC_* value is compiled into the JavaScript the browser loads when the app is built. Changing the file changes nothing until the app is built again.
| How you run it | After changing a value |
|---|---|
yarn dev | Stop it and run yarn dev again. |
yarn build and yarn start | Run yarn build again, then yarn start. |
| Docker Compose | Run docker compose up --build. Set the value in the .env beside docker-compose.yml, not in front-end. |
docker build for the dashboard | Build the image again with the value as a --build-arg. |
A role change reaches the dashboard only after a reload
When a role's permissions change, the API tells every signed-in admin's dashboard over a WebSocket, and the menus and buttons follow without a reload. The dashboard connects to NEXT_PUBLIC_WEBSOCKET_BASE_URL, the API's address without /api, and the API accepts the connection only from FRONTEND_URL, the dashboard's own address.
- Set both to where the apps really run, then restart the API and rebuild the dashboard.
- An unset
FRONTEND_URLaccepts onlyhttp://localhost:3030. - The dashboard also reads the permissions again on every page it opens, so nothing stays out of date for long.
The AI assistant asks for an API key
The server has no key for this model's provider. Add your own API key to keep going.The API has no key for the provider of the model you picked. Either paste your own key in the dialog, which stays in your browser, or add the provider's key to back-end/.env and restart the API (with Docker Compose, docker compose up again).
gemini-3.6-flash has no requests left on this API key right now. Pick a different model from the list above the chat, or try again in a few minutes.The provider refused the request because the key's quota is used up, which is common on a free key. Pick another model in the picker, or try again later.
A picture cannot be uploaded
Image uploads are not set up on this server yet. Add the Cloudflare R2 settings to the API environment to turn them on.Profile pictures and the assistant's image attachments are stored in a Cloudflare R2 bucket. Set the five R2_* variables in back-end/.env and restart the API. Everything else works without them.
The greeting shows no weather
The weather in the overview's greeting needs a WeatherAPI.com key in WEATHER_API_KEY, read by the dashboard's own server. Without it the greeting shows without the weather and nothing else changes.
- Without Docker, in the dashboard's
.env, then restart. - With Docker Compose, in the
.envbesidedocker-compose.yml, thendocker compose upagain. - With the dashboard's image, on
docker run:-e WEATHER_API_KEY=....
MySQL refuses to start or to seed
The API creates its tables in a database that already exists; it does not create the database itself. Create an empty database first, give its name to DB_DATABASE in back-end/.env, then run yarn seed.
- Check the five
DB_*connection values and thatDB_TYPE=mysql. - With
NODE_ENV=productionthe running API never creates tables, soyarn seed:prodhas to run once afteryarn build, before the first start. - The Docker image creates the database by itself only on SQLite. On MySQL, run
node dist/database/seeder.jsonce in the container yourself.
The API container cannot find its entrypoint
exec /usr/local/bin/docker-entrypoint.sh: no such file or directoryThe script has Windows line endings, which an editor or Git on Windows can add. The shipped API Dockerfile strips them while it builds, so this appears only with an image built from a changed Dockerfile. Keep its sed -i 's/\r$//' line, or save the script with LF line endings, then rebuild without the cache.
The folder looks different
Run the commands inside the folder the ZIP extracts to. If the unzip command is missing, extract it with your file manager instead; some tools add an extra folder named after the ZIP, so move into the inner one.
| Package | Folder | Contains |
|---|---|---|
| Full Stack | dashboard-2-full-stack | back-end, front-end, docker-compose.yml, README.md, QUICKSTART.md |
| Admin Dashboard | dashboard-2-front-end | Dockerfile, package.json, .env.example, messages, public, src |
Start over with fresh sample data
This deletes your data
Everything you created locally is removed, and the sample data comes back.
With the Full Stack in Docker, from the dashboard-2-full-stack folder:
dashboard-2-full-stackdocker compose down -v
docker compose upWithout Docker, stop the API, then in back-end:
back-endrm -f database.sqlite* && yarn seedIn PowerShell:
back-endRemove-Item database.sqlite*; yarn seedReset the sample data on the mock API
On the built-in mock API, the sample data and everything you changed live in your browser. Clear the site's data for the dashboard's address in your browser's settings and reload: the samples come back as they shipped.