Skip to content

Installation ​

This page walks through running Teldock on your own machine: the Node.js backend, the React frontend, and the MySQL/MariaDB database that stores metadata.

Prerequisites ​

RequirementVersion / notes
Node.js22.x or newer (20+ works, 22.x recommended)
MySQL / MariaDB8.0 or newer, running and reachable
FFmpegOptional. Required only for video preview generation. Image previews use Sharp and need no FFmpeg; without FFmpeg installed, video previews return 503.
Telegram bot + channelEach end user needs their own bot (via @BotFather) and a private storage channel.

Multi-user model

Teldock is multi-user. Every account connects its own bot token and private channel in Settings → Telegram Integration. The Telegram values in .env are for local development and testing only. See Connecting Telegram.

1. Clone the repository ​

bash
git clone https://github.com/Chaerulcp/Teldock.git
cd Teldock

2. Set up the backend ​

bash
cd backend
npm install
cp .env.example .env      # then edit .env (see Configuration)
npm run migrate           # create all database tables
npm run dev               # start the API on http://localhost:3001

Keep this terminal open. npm run dev starts the API with auto-reload via nodemon; use npm start for a plain Node process.

Windows / PowerShell

cp is a Unix command. On Windows PowerShell, copy the example file with:

powershell
Copy-Item .env.example .env

Before the server boots, open backend/.env and set at least the database credentials and the three required secrets (JWT_SECRET, REFRESH_TOKEN_SECRET, ENCRYPTION_KEY). See Configuration.

3. Set up the frontend ​

In a new terminal:

bash
cd frontend
npm install
npm run dev               # start the SPA on http://localhost:3000

Vite proxies /api requests to the backend automatically, so the browser can call http://localhost:3000/api/... during development.

4. Verify the backend is up ​

bash
curl http://localhost:3001/api/health

Expected response:

json
{ "success": true, "message": "API is running", "timestamp": "..." }

Then open http://localhost:3000, register an account, and continue with Connecting Telegram.

Services and ports ​

ServiceURLPort
Frontend (React SPA)http://localhost:30003000
Backend (Express API)http://localhost:3001/api3001
Database (MySQL/MariaDB)localhost3306

Common commands ​

LocationCommandPurpose
backendnpm run devStart the API with auto-reload
backendnpm startStart the API as a plain Node process
backendnpm run migrateCreate/sync database tables
backendnpm run test-dbVerify the database setup
backendnpm run test-authRun the auth test script
frontendnpm run devStart the Vite dev server
frontendnpm run buildProduction build

The server refuses to boot without real secrets

At startup the backend validates JWT_SECRET, REFRESH_TOKEN_SECRET and ENCRYPTION_KEY. If any of them is missing, shorter than 32 characters, or still set to a placeholder value from .env.example, the process exits with an error instead of starting. This is enforced in backend/src/config/secrets.js so a misconfigured deployment fails immediately rather than silently using a public default.

Generate strong secrets

Do not run Teldock with the example secrets. Generate random values (see Configuration) and keep them stable — changing ENCRYPTION_KEY later makes previously encrypted credentials and files unreadable.

Next steps ​

Released under the MIT License.