docs(readme): update README

This commit is contained in:
KodekaTeam committed 2026-07-08 17:13:28 +07:00
1 parent 001ba48651
commit 7ebdaca2e5
2 files changed
+257 -545

No files matched your search

+147 -291
View File
@@ -11,344 +11,200 @@
</div>
Doktainer adalah platform open-source dan self-hosted untuk mengelola server, aplikasi, container, domain, SSL, backup, dan operasi deployment dari satu panel web.
---
Doktainer ditujukan untuk tim atau individu yang ingin memiliki panel deployment sendiri tanpa bergantung pada vendor cloud tertentu, sekaligus tetap memegang kendali penuh atas server dan data mereka.
## Ringkasan
## Fitur Utama
Doktainer adalah platform manajemen Docker open-source dan self-hosted yang membantu Anda mengelola server, aplikasi, container, domain, SSL, backup, dan deployment dari satu antarmuka web. Dirancang untuk individu dan tim yang menginginkan kendali penuh atas infrastruktur mereka tanpa vendor lock-in.
- Manajemen Multi-server, Multi-Proyek and Multi-Container dalam satu panel.
- Manajemen aplikasi dan container berbasis Docker.
- Dukungan untuk domain, SSL, jaringan, keamanan, log, metrik, dan akses terminal.
- Organisasi, akses berbasis peran, API key, dan konfigurasi pengaturan pengguna.
- Integrasi Git provider, tujuan penyimpanan, notifikasi, dan backup.
- UI panel modern dengan Next.js dan API backend yang berjalan terpisah saat runtime.
- Dukungan untuk pengembangan lokal dan deployment Docker ke VPS atau server online.
---
## Kebutuhan Sistem
## ✨ Fitur
### Minimum untuk pengembangan
Doktainer memiliki berbagai fitur yang bisa Anda gunakan.
- Node.js 22 atau versi yang kompatibel dengan dependensi proyek ini.
- npm 10 atau versi yang disertakan pada rilis Node.js modern.
- PostgreSQL 16 atau service PostgreSQL yang kompatibel.
- Docker Desktop atau Docker Engine + Docker Compose v2 jika ingin melakukan deployment dengan container.
- Manajemen multi-server
- Manajemen Docker & container
- Deployment aplikasi
- Manajemen domain & SSL
- Log, metrik & monitoring
- Organisasi & Role-Based Access Control (RBAC)
- API Keys
- Integrasi Git
- Integrasi backup
- Terminal bawaan
- Fastify API + Next.js frontend
- Self-hosted & Open Source
### Port default
---
- `3000` untuk frontend Next.js
- `4000` untuk backend Fastify
- `5432` untuk PostgreSQL
## Persyaratan
## Quick Start Lokal
- Node.js 22+
- PostgreSQL 16+
- Docker Engine + Compose v2 (opsional)
### 1. Clone repository
---
## Mulai Cepat
Untuk memulai, jalankan perintah berikut di VPS:
```bash
curl -sSL https://doktainer.com/install.sh | sh
```
## Mulai Cepat (Lokal)
### Clone repositori
```bash
git clone https://github.com/DoktainerApp/doktainer.git
cd doktainer
```
### 2. Install dependensi
### Install dependensi
```bash
npm install
```
### 3. Siapkan environment
Salin file environment contoh dan sesuaikan nilainya.
### Konfigurasi environment
```bash
cp .env.example .env
```
Untuk Windows PowerShell:
```powershell
Copy-Item .env.example .env
```
Nilai minimum yang perlu diperhatikan:
```env
NODE_ENV=development
PORT=4000
HOST=0.0.0.0
DATABASE_URL=postgresql://doktainer:doktainerdb@postgres:5432/doktainer?schema=public
JWT_SECRET=change-this-to-a-secure-secret-with-32-chars-min
ENCRYPTION_KEY=change-this-to-a-secure-32-char-key
FRONTEND_URL=http://localhost:3000
NEXT_PUBLIC_API_URL=http://localhost:4000/api/v1
NEXT_PUBLIC_WS_URL=ws://localhost:4000
```
Catatan penting:
- `JWT_SECRET` harus memiliki panjang minimal 32 karakter, jika tidak backend akan gagal berjalan.
- `DATABASE_URL` harus valid. Jika salah, autentikasi dan startup backend akan gagal lebih awal.
- `ENCRYPTION_KEY` sebaiknya diganti sebelum digunakan di environment nyata.
### 4. Siapkan database
Pastikan PostgreSQL berjalan, lalu generate Prisma client dan sinkronkan skema:
### Konfigurasi database
```bash
npm run db:generate
npm run db:push
```
Jika menggunakan workflow migrasi pengembangan, Anda juga dapat menjalankan:
```bash
npm run db:migrate
```
### 5. Jalankan server pengembangan
### Jalankan server pengembangan
```bash
npm run dev
```
Setelah berhasil:
Buka:
- frontend tersedia di `http://localhost:3000`
- backend tersedia di `http://localhost:4000`
- health check backend tersedia di `http://localhost:4000/health`
## Menjalankan Secara Lokal dalam Mode Production Tanpa Docker
Jika ingin menjalankan mode production di mesin lokal:
```bash
npm run build
npm run start
```
Frontend
http://localhost:3000
Perintah ini akan:
- membangun frontend Next.js
- mengompilasi backend TypeScript ke folder `dist`
- menjalankan frontend production dan backend production secara bersamaan
## Instalasi Online / VPS dengan Docker
Pendekatan ini paling cocok untuk server online, instance VPS, atau environment self-hosted. Proyek ini sudah menyediakan:
- `Dockerfile`
- `docker-compose.yml`
- `docker-compose.build.yml`
- `docker-entrypoint.sh`
- `.env.docker`
### Deployment yang direkomendasikan
Gunakan alur ini jika Anda membangun image langsung dari source proyek di server.
1. Salin proyek ke server.
2. Edit `.env.docker` sesuai kebutuhan.
3. Jalankan:
```bash
docker compose -f docker-compose.yml -f docker-compose.build.yml up -d --build
Backend
http://localhost:4000
```
Jika ingin menggunakan image dari registry, sesuaikan `DOKTAINER_IMAGE` di `.env.docker` dan pastikan strategi deployment tetap konsisten dengan definisi Compose yang aktif.
### Service yang dijalankan
Setup Docker Compose default akan menjalankan:
- `postgres` untuk database PostgreSQL
- `app` untuk frontend Next.js dan backend Fastify dalam satu container aplikasi
Mapping port default:
- `3000:3000` untuk frontend
- `4000:4000` untuk backend
- `5432:5432` untuk PostgreSQL
### Langkah deployment Docker yang direkomendasikan
1. Salin proyek ke server/VPS Linux.
2. Pastikan Docker dan Docker Compose v2 sudah terpasang.
3. Edit `.env.docker` dan ganti secret default.
4. Jalankan perintah build/deploy Compose.
5. Periksa log container.
6. Verifikasi `http://SERVER-IP:3000` dan `http://SERVER-IP:4000/health`.
7. Siapkan reverse proxy dan HTTPS untuk penggunaan production publik.
Contoh untuk melihat log:
```bash
docker compose logs -f app
docker compose logs -f postgres
```
Menghentikan service:
```bash
docker compose down
```
Menghentikan service dan menghapus volume database:
```bash
docker compose down -v
```
## Konfigurasi Runtime Docker
File `.env.docker` adalah sumber environment utama untuk deployment container. Variabel paling penting adalah:
```env
POSTGRES_DB=doktainer
POSTGRES_USER=doktainer
POSTGRES_PASSWORD=replace-this-password
POSTGRES_PORT=5432
NODE_ENV=production
HOST=0.0.0.0
PORT=4000
DATABASE_URL=postgresql://doktainer:replace-this-password@postgres:5432/doktainer?schema=public
JWT_SECRET=replace-this-with-a-secure-32-char-secret
ENCRYPTION_KEY=replace-this-with-a-secure-32-char-key
NEXT_PUBLIC_PANEL_NAME=DOKTAINER
NEXT_PUBLIC_VERSION=v0.1.3
NEXT_PUBLIC_BATCH=Batch-20260623
NEXT_PUBLIC_API_PORT=4000
```
Catatan penting deployment:
- Untuk deployment production, `NEXT_PUBLIC_API_URL` sebaiknya dibiarkan kosong agar browser menggunakan same-origin `/api/v1`.
- Jika Doktainer berjalan di belakang Nginx, Traefik, Caddy, atau Cloudflare Tunnel, aktifkan `TRUST_PROXY=true`.
- Atur `FRONTEND_URL` atau `NEXT_PUBLIC_PANEL_URL` hanya jika Anda benar-benar ingin memaksa satu URL publik kanonis.
- Jangan gunakan `localhost`, `0.0.0.0`, atau host Docker internal sebagai URL production publik.
## Reverse Proxy dan HTTPS
Untuk penggunaan online, sangat disarankan menempatkan Doktainer di belakang reverse proxy seperti:
- Nginx
- Traefik
- Caddy
- Cloudflare Tunnel
Tujuannya adalah untuk:
- menyediakan HTTPS
- meneruskan header host dan protokol dengan benar
- menyederhanakan akses publik dengan domain Anda sendiri
- mengurangi paparan backend langsung ke internet
Jika menggunakan reverse proxy, periksa dua hal berikut:
- set `TRUST_PROXY=true`
- set `FRONTEND_URL=https://your-domain.com` jika Anda membutuhkan URL absolut yang konsisten
## Workflow Pengembangan yang Tersedia
Script utama proyek:
```bash
npm run dev
npm run build
npm run start
npm run lint
npm run test
npm run db:generate
npm run db:push
npm run db:migrate
npm run db:studio
```
Ringkasan fungsi:
- `npm run dev` menjalankan frontend dan backend dalam mode development.
- `npm run build` membangun frontend dan mengompilasi backend.
- `npm run start` menjalankan output build production.
- `npm run lint` menjalankan ESLint.
- `npm run test` menjalankan test suite TypeScript.
- `npm run db:generate` membuat Prisma client.
- `npm run db:push` menyinkronkan skema ke database.
- `npm run db:migrate` membuat dan menerapkan migrasi development.
- `npm run db:studio` membuka Prisma Studio.
## Troubleshooting
### Login atau register gagal
Jika login atau registrasi mengembalikan `Internal Server Error`, hampir selalu mulai dari pengecekan berikut:
1. pastikan `DATABASE_URL` benar
2. pastikan PostgreSQL benar-benar berjalan
3. pastikan `JWT_SECRET` valid dan memiliki panjang minimal 32 karakter
4. jalankan ulang `npm run db:generate`, lalu `npm run db:push`
### Backend gagal berjalan
Kemungkinan penyebab umum:
- port `4000` sudah digunakan oleh proses lain
- koneksi PostgreSQL gagal
- `JWT_SECRET` kosong atau terlalu pendek
### Container app langsung berhenti
Periksa:
- `DATABASE_URL` di `.env.docker`
- password Postgres di `POSTGRES_PASSWORD`
- log container dengan `docker compose logs -f app`
Docker entrypoint proyek ini akan:
- menunggu sampai database dapat diakses
- menjalankan `prisma migrate deploy` jika migrasi tersedia
- fallback ke `prisma db push` jika belum ada migrasi
- menjalankan backend dan frontend dalam satu container
## Catatan Arsitektur
Doktainer di folder ini menggunakan model repository monolith modular dengan dua runtime utama:
- Next.js untuk antarmuka web pada port `3000`
- API Fastify pada port `4000`
Keduanya digabungkan dalam satu proyek untuk menyederhanakan pengembangan dan deployment, sekaligus menjaga pemisahan frontend dan backend tetap jelas pada level runtime.
## Lisensi
Doktainer menggunakan lisensi MIT. Lihat file `LICENSE` di root repository untuk detail lisensi.
#### Penggunaan Non-Komersial Saja
Software ini bebas digunakan, dimodifikasi, dan didistribusikan hanya untuk **tujuan non-komersial**. Penggunaan untuk aktivitas yang menghasilkan pendapatan atau di dalam organisasi profit dilarang keras berdasarkan ketentuan ini.
#### Lisensi Komersial
Jika ingin menggunakan Doktainer untuk tujuan komersial, operasional bisnis, atau sebagai bagian dari layanan berbayar, Anda harus memperoleh lisensi komersial terpisah. Silakan hubungi author untuk informasi lebih lanjut.
---
## ❤️ Sponsors
## 🐳 Deployment Docker
Terima kasih kepada sponsor yang sudah mendukung Doktainer.
Doktainer sudah mencakup semua yang diperlukan untuk deployment Docker.
| Sponsor | Website | Jenis Sponsor |
| --------------- | ----------------------- | ----------------- |
| **IDCloudhost** | https://idcloudhost.com | Cloud Hosting |
| **SumoPod** | https://sumopod.com | Cloud Hosting |
| **PAAS ID** | https://paas.id | Cloud Hosting |
| **Ktikme** | https://ktik.me | Profile BIO-Link |
| **Dahono Labs** | https://labs.dahono.com | AI Agent Services |
```bash
docker compose up -d
```
Tertarik juga untuk menjadi sponsor Doktainer?
Hubungi kami melalui [**Discord Server Community**](https://discord.gg/3HF85Cd6fp)
Untuk deployment produksi, instalasi VPS, reverse proxy, SSL, dan konfigurasi runtime, silakan merujuk ke dokumentasi.
---
<p align="center">Dibuat dengan cinta oleh KodekaTeam</p>
## 📚 Dokumentasi
Dokumentasi lengkap tersedia di
> https://docs.doktainer.com
Meliputi:
- Instalasi
- Deployment Docker
- Reverse Proxy
- Variabel Lingkungan
- Pengembangan
- API
- Pemecahan Masalah
---
## 🏗️ Arsitektur
Doktainer terdiri dari:
- **Next.js** frontend
- **Fastify** backend
- **PostgreSQL**
- **Docker Engine**
Dirancang sebagai modular monolith untuk pengalaman pengembangan yang sederhana, namun tetap memisahkan tanggung jawab frontend dan backend.
---
## 🛣️ Roadmap
- ✅ Multi Project
- ✅ Multi Server
- ✅ Manajemen Docker
- ✅ Organisasi
- ✅ Domain & SSL
- ✅ RBAC
- ✅ Terminal
- ✅ App Installer
- ✅ Template Docker Compose
- ✅ Deployment Satu-Klik
- 🚧 Docker SWARM
- 🚧 Manajemen Cluster
- 🚧 Dukungan Kubernetes
---
## 🤝 Berkontribusi
Kontribusi sangat diterima!
Baik itu memperbaiki bug, menyempurnakan dokumentasi, atau mengusulkan fitur baru, kami sangat menghargai bantuan Anda.
Silakan baca Panduan Berkontribusi sebelum membuka Pull Request.
---
## ❤️ Sponsor
Terima kasih kepada semua yang mendukung Doktainer.
| Sponsor | Tipe Sponsor |
| ------------------------------------------ | ----------------- |
| [**IDCloudhost**](https://idcloudhost.com) | Cloud Hosting |
| [**Sumopod**](https://sumopod.com) | Cloud Hosting |
| [**PAAS ID**](https://paas.id) | Cloud Hosting |
| [**Ktikme**](https://ktik.me) | Profile BIO-Link |
| [**Dahono Labs**](https://labs.dahono.com) | AI Agent Services |
Tertarik menjadi sponsor Doktainer?
Bergabunglah dengan [**Komunitas Discord**](https://discord.gg/3HF85Cd6fp) kami.
---
## 📄 Lisensi
Doktainer menggunakan lisensi MIT. Lihat file `LICENSE` di root repositori untuk detail lisensi.
#### 🚫 Hanya Penggunaan Non-Komersial
Perangkat lunak ini gratis untuk digunakan, dimodifikasi, dan didistribusikan **untuk tujuan non-komersial saja**. Segala penggunaan untuk kegiatan yang menghasilkan pendapatan atau di dalam organisasi yang mencari laba sangat dilarang berdasarkan ketentuan ini.
#### 💼 Lisensi Komersial
Jika Anda ingin menggunakan Doktainer untuk tujuan komersial, operasional bisnis, atau sebagai bagian dari layanan berbayar, Anda harus memperoleh lisensi komersial terpisah. Silakan hubungi penulis untuk informasi lebih lanjut.
---
<div align="center">
Dibuat dengan ❤️ oleh KodekaTeam
</div>
+110 -254
View File
@@ -11,316 +11,185 @@
</div>
Doktainer is an open-source, self-hosted platform for managing servers, applications, containers, domains, SSL, backups, and deployment operations from a single web panel.
---
Doktainer is intended for teams or individuals who want to own their own deployment panel without depending on a specific cloud vendor, while still retaining full control over their servers and data.
## Overview
## Key Features
Doktainer is an open-source, self-hosted Docker management platform that helps you manage servers, applications, containers, domains, SSL, backups, and deployments from a single web interface. Designed for individuals and teams who want full control over their infrastructure without vendor lock-in.
- Multi-server management, Multi-Project and Multi-Container in one panel.
- Docker-based application and container management.
- Support for domains, SSL, networks, security, logs, metrics, and terminal access.
- Organizations, role-based access, API keys, and user settings configuration.
- Git provider, storage destination, and notification/backup integrations.
- Modern panel UI with Next.js and a backend API that runs separately at runtime.
- Support for local development and Docker deployment to a VPS or online server.
---
## System Requirements
## ✨ Features
### Minimum for development
Doktainer includes multiple features that you can use.
- Node.js 22 or a version compatible with this project's dependencies.
- npm 10 or the version bundled with modern Node.js releases.
- PostgreSQL 16 or a compatible PostgreSQL service.
- Docker Desktop or Docker Engine + Docker Compose v2 if you want to deploy with containers.
- Multi-server management
- Docker & container management
- Application deployment
- Domain & SSL management
- Logs, metrics & monitoring
- Organizations & Role-Based Access Control (RBAC)
- API Keys
- Git integrations
- Backup integrations
- Built-in terminal
- Fastify API + Next.js frontend
- Self-hosted & Open Source
### Default ports
---
- `3000` for the Next.js frontend
- `4000` for the Fastify backend
- `5432` for PostgreSQL
## Requirements
- Node.js 22+
- PostgreSQL 16+
- Docker Engine + Compose v2 (optional)
---
## Quick Start
To get started, run the following command on a VPS:
```bash
curl -sSL https://doktainer.com/install.sh | sh
```
## Local Quick Start
### 1. Clone the repository
### Clone the repository
```bash
git clone https://github.com/DoktainerApp/doktainer.git
cd doktainer
```
### 2. Install dependencies
### Install dependencies
```bash
npm install
```
### 3. Prepare the environment
Copy the example environment file and adjust the values.
### Configure environment
```bash
cp .env.example .env
```
For Windows PowerShell:
```powershell
Copy-Item .env.example .env
```
Minimum values that need attention:
```env
NODE_ENV=development
PORT=4000
HOST=0.0.0.0
DATABASE_URL=postgresql://doktainer:doktainerdb@postgres:5432/doktainer?schema=public
JWT_SECRET=change-this-to-a-secure-secret-with-32-chars-min
ENCRYPTION_KEY=change-this-to-a-secure-32-char-key
FRONTEND_URL=http://localhost:3000
NEXT_PUBLIC_API_URL=http://localhost:4000/api/v1
NEXT_PUBLIC_WS_URL=ws://localhost:4000
```
Important notes:
- `JWT_SECRET` must be at least 32 characters long, otherwise the backend will fail to start.
- `DATABASE_URL` must be valid. If it is incorrect, authentication and backend startup will fail early.
- `ENCRYPTION_KEY` should be changed before being used in a real environment.
### 4. Prepare the database
Make sure PostgreSQL is running, then generate the Prisma client and synchronize the schema:
### Prepare the database
```bash
npm run db:generate
npm run db:push
```
If you use the development migration workflow, you can also run:
```bash
npm run db:migrate
```
### 5. Run the development server
### Start development
```bash
npm run dev
```
Once it succeeds:
Open:
- the frontend is available at `http://localhost:3000`
- the backend is available at `http://localhost:4000`
- the backend health check is available at `http://localhost:4000/health`
```
Frontend
http://localhost:3000
## Running Locally in Production Mode Without Docker
Backend
http://localhost:4000
```
If you want to run production mode on a local machine:
---
## 🐳 Docker Deployment
Doktainer includes everything needed for Docker deployment.
```bash
npm run build
npm run start
docker compose up -d
```
This command will:
For production deployments, VPS installation, reverse proxy, SSL, and runtime configuration, please refer to the documentation.
- build the Next.js frontend
- compile the TypeScript backend into the `dist` folder
- run the production frontend and production backend together
---
## Online / VPS Installation With Docker
## 📚 Documentation
This approach is best suited for online servers, VPS instances, or self-hosted environments. This project already provides:
Complete documentation is available at
- `Dockerfile`
- `docker-compose.yml`
- `docker-compose.build.yml`
- `docker-entrypoint.sh`
- `.env.docker`
> https://docs.doktainer.com
### Recommended deployment
Including:
Use this flow if you build the image directly from the project source on the server.
- Installation
- Docker Deployment
- Reverse Proxy
- Environment Variables
- Development
- API
- Troubleshooting
1. Copy the project to the server.
2. Edit `.env.docker` as needed.
3. Run:
---
```bash
docker compose -f docker-compose.yml -f docker-compose.build.yml up -d --build
```
## 🏗️ Architecture
If you want to use an image from a registry, adjust `DOKTAINER_IMAGE` in `.env.docker` and make sure your deployment strategy remains consistent with the active Compose definitions.
Doktainer consists of:
### Services that are started
- **Next.js** frontend
- **Fastify** backend
- **PostgreSQL**
- **Docker Engine**
The default Docker Compose setup will run:
Designed as a modular monolith for a simple development experience while keeping frontend and backend responsibilities separated.
- `postgres` for the PostgreSQL database
- `app` for the Next.js frontend and Fastify backend in a single application container
---
Default port mappings:
## 🛣️ Roadmap
- `3000:3000` for the frontend
- `4000:4000` for the backend
- `5432:5432` for PostgreSQL
- ✅ Multi Project
- ✅ Multi Server
- ✅ Docker Management
- ✅ Organizations
- ✅ Domains & SSL
- ✅ RBAC
- ✅ Terminal
- ✅ App Installer
- ✅ Docker Compose Templates
- ✅ One-Click Deployments
- 🚧 Docker SWARM
- 🚧 Cluster Management
- 🚧 Kubernetes Support
### Recommended Docker deployment steps
---
1. Copy the project to a Linux server/VPS.
2. Make sure Docker and Docker Compose v2 are installed.
3. Edit `.env.docker` and replace the default secrets.
4. Run the Compose build/deploy command.
5. Check the container logs.
6. Verify `http://SERVER-IP:3000` and `http://SERVER-IP:4000/health`.
7. Set up a reverse proxy and HTTPS for public production use.
## 🤝 Contributing
Example for viewing logs:
Contributions are welcome!
```bash
docker compose logs -f app
docker compose logs -f postgres
```
Whether it's fixing bugs, improving documentation, or proposing new features, we'd love to have your help.
Stopping the services:
Please read our Contributing Guide before opening a Pull Request.
```bash
docker compose down
```
---
Stopping the services and removing the database volume:
## ❤️ Sponsors
```bash
docker compose down -v
```
Thanks to everyone supporting Doktainer.
## Docker Runtime Configuration
| Sponsor | Sponsor Type |
| ------------------------------------------ | ----------------- |
| [**IDCloudhost**](https://idcloudhost.com) | Cloud Hosting |
| [**Sumopod**](https://sumopod.com) | Cloud Hosting |
| [**PAAS ID**](https://paas.id) | Cloud Hosting |
| [**Ktikme**](https://ktik.me) | Profile BIO-Link |
| [**Dahono Labs**](https://labs.dahono.com) | AI Agent Services |
The `.env.docker` file is the main environment source for container deployment. The most important variables are:
Interested in sponsoring Doktainer?
```env
POSTGRES_DB=doktainer
POSTGRES_USER=doktainer
POSTGRES_PASSWORD=replace-this-password
POSTGRES_PORT=5432
Join our [**Discord Community**](https://discord.gg/3HF85Cd6fp).
NODE_ENV=production
HOST=0.0.0.0
PORT=4000
DATABASE_URL=postgresql://doktainer:replace-this-password@postgres:5432/doktainer?schema=public
---
JWT_SECRET=replace-this-with-a-secure-32-char-secret
ENCRYPTION_KEY=replace-this-with-a-secure-32-char-key
NEXT_PUBLIC_PANEL_NAME=DOKTAINER
NEXT_PUBLIC_VERSION=v0.1.3
NEXT_PUBLIC_BATCH=Batch-20260623
NEXT_PUBLIC_API_PORT=4000
```
Important deployment notes:
- For purpose deployment, `NEXT_PUBLIC_API_URL` should be left empty so the browser uses the same-origin `/api/v1`.
- If Doktainer runs behind Nginx, Traefik, Caddy, or Cloudflare Tunnel, enable `TRUST_PROXY=true`.
- Set `FRONTEND_URL` or `NEXT_PUBLIC_PANEL_URL` only if you truly want to force a single canonical public URL.
- Do not use `localhost`, `0.0.0.0`, or an internal Docker host as the public production URL.
## Reverse Proxy and HTTPS
For online use, it is highly recommended to place Doktainer behind a reverse proxy such as:
- Nginx
- Traefik
- Caddy
- Cloudflare Tunnel
The goals are to:
- provide HTTPS
- forward host and protocol headers correctly
- simplify public access with your own domain
- reduce direct backend exposure to the internet
If you use a reverse proxy, check the following two things:
- set `TRUST_PROXY=true`
- set `FRONTEND_URL=https://your-domain.com` if you need consistent absolute URLs
## Available Development Workflow
Main project scripts:
```bash
npm run dev
npm run build
npm run start
npm run lint
npm run test
npm run db:generate
npm run db:push
npm run db:migrate
npm run db:studio
```
Function summary:
- `npm run dev` runs the frontend and backend in development mode.
- `npm run build` builds the frontend and compiles the backend.
- `npm run start` runs the production build output.
- `npm run lint` runs ESLint.
- `npm run test` runs the TypeScript test suite.
- `npm run db:generate` generates the Prisma client.
- `npm run db:push` synchronizes the schema to the database.
- `npm run db:migrate` creates and applies development migrations.
- `npm run db:studio` opens Prisma Studio.
## Troubleshooting
### Login or register fails
If login or registration returns `Internal Server Error`, almost always start with the following checks:
1. make sure `DATABASE_URL` is correct
2. make sure PostgreSQL is actually running
3. make sure `JWT_SECRET` is valid and at least 32 characters long
4. rerun `npm run db:generate`, then `npm run db:push`
### Backend fails to start
Common possible causes:
- port `4000` is already used by another process
- PostgreSQL connection fails
- `JWT_SECRET` is empty or too short
### App container exits immediately
Check:
- `DATABASE_URL` in `.env.docker`
- the Postgres password in `POSTGRES_PASSWORD`
- container logs with `docker compose logs -f app`
This project's Docker entrypoint will:
- wait until the database can be accessed
- run `prisma migrate deploy` if migrations are available
- fall back to `prisma db push` if no migrations exist yet
- start the backend and frontend in a single container
## Architecture Notes
Doktainer in this folder uses a modular monolith repository model with two main runtimes:
- Next.js for the web interface on port `3000`
- Fastify API on port `4000`
Both are combined in a single project to simplify development and deployment, while keeping the frontend and backend separation clear at the runtime level.
## License
## 📄 License
Doktainer uses the MIT license. See the `LICENSE` file in the repository root for license details.
@@ -334,21 +203,8 @@ If you wish to use Doktainer for commercial purposes, business operations, or as
---
## ❤️ Sponsors
<div align="center">
Thanks to our sponsors for supporting Doktainer.
Built with ❤️ by KodekaTeam
| Sponsor | Website | Sponsor Type |
| --------------- | ----------------------- | ----------------- |
| **IDCloudhost** | https://idcloudhost.com | Cloud Hosting |
| **SumoPod** | https://sumopod.com | Cloud Hosting |
| **PAAS ID** | https://paas.id | Cloud Hosting |
| **Ktikme** | https://ktik.me | Profile BIO-Link |
| **Dahono Labs** | https://labs.dahono.com | AI Agent Services |
Interested in sponsoring Doktainer?
Contact us at [**Discord Server Community**](https://discord.gg/3HF85Cd6fp)
---
<p align="center">Built with ❤️ by the KodekaTeam</p>
</div>