MangoPanel is an hPanel-style shared hosting control panel. This repository currently contains the first foundation build from Project.md: a runnable API, SQLite control-plane database, Vue CDN client/admin/status pages, dev seed data, and smoke tests.
- Python standard-library HTTP API.
- SQLite schema and development seed data.
- JWT-style signed access tokens.
- Mandatory TOTP flow, with development-only code
000000. - Public client signup page at
/signup. - Client panel at
/on the client port. - First-admin setup page at
/adminwhen no admin exists, and/admin/setupfor explicit setup checks on the admin port. - Admin panel at
/adminon the admin port. - Public status page at
/statuson the client port. - Development API coverage for hosting accounts, websites, DNS records, SSL jobs, launch tokens, databases, mailboxes, backups, cron jobs, Git deployments, jobs, audit logs, and status incidents.
- Node-agent job runner with simulated and Docker Compose execution modes.
- Account-stack generator for OpenLiteSpeed, Filebrowser, phpMyAdmin, MariaDB, cron, SFTP, and shared-mail-edge/mailbox-storage scaffolding.
- DNS provider foundation and delegated sync with admin DNS settings, local PowerDNS/Cloudflare provider records, encrypted Cloudflare token storage, per-plan DNS policy fields, client DNS policy enforcement, provider migration, nameserver verification, zone export snapshots, and agent-backed provider publishing.
This is not the production hosting runtime yet. The agent now generates account filesystem layout and Docker Compose files, but real ACME and quota enforcement still need their production providers.
| Client Overview Dashboard | Super Admin 2FA Verification |
|---|---|
![]() |
![]() |
| Super Admin Console | Real-Time Telemetry Stream |
|---|---|
![]() |
![]() |
| Storage & Filesystem IOPS Breakdown | Client Portal Sign-In |
|---|---|
![]() |
![]() |
| Built for Performance | Essential Tools Included | 70% Resource Savings |
|---|---|---|
![]() |
![]() |
![]() |
| Per-Account Isolation | Clean Admin & Client UX | 100% Self-Hosted Data |
|---|---|---|
![]() |
![]() |
![]() |
| Scalable Architecture | 5-Step Simple Migration | Control & Profit |
|---|---|---|
![]() |
![]() |
![]() |
MangoPanel can use Cloudflare as the authoritative DNS provider for managed domains. Configure the Cloudflare account in the Admin panel under DNS Settings before assigning Cloudflare DNS to a plan or domain.
Before calling the Cloudflare API, you will need two pieces of information:
- Account ID: Located in the right sidebar of the Cloudflare Dashboard on any domain's Overview page, or by calling the
/accountsendpoint. - API Token: Generated under My Profile > API Tokens in Cloudflare.
The API token must include this permission:
- Zone > Zone > Edit
- Zone > DNS > Edit
For production, store the token only in MangoPanel's encrypted provider settings. Do not commit it to source code or place it in a public environment file. After saving the credentials, use the provider test in the Admin panel to confirm that the token can access and manage zones.
To instruct users to set up a server domain or subdomain for MangoPanel and tool access, create the following DNS records pointing to your server's IP address.
For example, if you want your users to reach the panel from hosting.servermango.com, create the following A records:
| Type | Name / Host | Target / Value | Purpose |
|---|---|---|---|
| A | hosting.servermango.com (or @) |
<SERVER_IP> |
Main panel and web traffic |
| A | *.files.hosting.servermango.com (or *.files) |
<SERVER_IP> |
Per-account Filebrowser tool routing |
Once configured, access MangoPanel at:
- Admin Panel:
http://hosting.servermango.com:8001/admin - Client Panel:
http://hosting.servermango.com:8000/client(orhttp://hosting.servermango.com:8000/)
Fresh clone with git:
git clone https://github.com/servermango/MangoPanel.git MangoPanel && cd MangoPanel && bash scripts/install.shIf git is not installed:
mkdir MangoPanel && curl -fsSL https://codeload.github.com/servermango/MangoPanel/tar.gz/refs/heads/main | tar -xz -C MangoPanel --strip-components=1 && cd MangoPanel && bash scripts/install.shThat tarball path installs git, then initializes the repo metadata and sets origin to https://github.com/servermango/MangoPanel.git so future git pull updates work normally.
cd MangoPanel
make install # install system prerequisites, Python env, Docker tooling, and pre-pull project images
make dev-init # check Python, Docker, and ports
make dev-up # start the client + admin panels (seeds dev data on first run)Then open the client panel at http://127.0.0.1:8000/ and the admin panel at http://127.0.0.1:8001/admin, or use the public IP shown in the startup banner if you are on a server. Log in with the seed credentials below (TOTP code 000000 in dev mode). That's all you need for day-to-day work; the rest of this document explains how the pieces fit together.
MangoPanel includes a portable service wrapper at scripts/service. It manages the panel and a separate queue worker with PID files and log files, so it works the same way on Linux and macOS without depending on systemd or launchd.
bash scripts/service mangopanel start
bash scripts/service mangopanel status
bash scripts/service mangopanel restart
bash scripts/service mangopanel stopIf you prefer make, the same wrapper is exposed as:
make service ACTION=start
make service ACTION=status
make service ACTION=restart
make service ACTION=stopBy default it runs the production-style panel process in the background and a worker loop that drains queued jobs. Logs go to var/mangopanel.log and var/mangopanel-worker.log. You can override ports and paths with the same MP_* environment variables the app already uses, plus:
MANGOPANEL_PID_FILEMANGOPANEL_LOG_FILEMANGOPANEL_PYTHONMANGOPANEL_WORKER_PID_FILEMANGOPANEL_WORKER_LOG_FILE
The wrapper starts the app with MP_ENV=production unless you set a different value before calling it. It also runs the worker with MP_AGENT_INLINE=false so provisioning stays asynchronous.
MangoPanel is a single Python program (mangopanel/app.py) that serves two HTTP panels and an API, backed by one SQLite database. There is no external web framework — it uses only the standard library.
- Two panels, two ports.
make dev-upstarts one process that binds two ports: the client panel on8000and the admin panel on8001. Each port only serves its own routes (/api/client/*vs/api/admin/*), so the panels stay isolated. Public routes (/api/public/*,/status) are reachable from either. - Auth. Login is two steps: email + password returns a short-lived challenge token, then a TOTP code exchanges it for an access token (a signed JWT). In development,
MP_DEV_AUTH_TEST_MODE=trueaccepts the bypass code000000. All access tokens are checked on every/api/clientand/api/adminrequest. - Control plane (SQLite). Every panel action writes desired-state rows (users, hosting accounts, websites, databases, mailboxes, etc.) and an audit/activity entry. The API never touches Docker or the filesystem directly.
- Node agent. State-changing actions enqueue a row in the
jobstable. The agent (mangopanel/agent.py) picks up jobs and does the privileged work — creating the account directory layout and rendering Docker Compose files (mangopanel/stack.py). In dev,MP_AGENT_INLINE=trueruns jobs immediately insimulatemode (files written, no containers). SetMP_AGENT_MODE=dockerto actually launch per-account containers (OpenLiteSpeed, Filebrowser, phpMyAdmin, MariaDB, cron, SFTP, and the mailbox storage/routing scaffolding that will sit behind the shared mail edge). - Config. Everything is driven by environment variables read in
mangopanel/config.py(MP_*), with sensible local defaults — so the Makefile targets work with no setup.
Request flow in one line: browser → panel API (writes SQLite + enqueues job) → agent (provisions files/containers) → status reported back to SQLite → panel shows result.
MangoPanel is also being considered as a practical case study for Tariq Abdullah's Cloud Definition Language M.Tech thesis work.
The integration would explore how a real shared-hosting platform can express infrastructure intent at a semantic level: hosting accounts, workloads, network boundaries, DNS, certificates, mail routing, storage, quotas, backups, and deployment constraints. That intent could then be compiled into environment-specific artifacts while preserving explainability and reporting where behavior is exact, partial, degraded, or unsupported.
This direction is exploratory and will be introduced incrementally alongside the existing MangoPanel runtime.
All persistent state lives in a single user_files/ directory in the project root, so a server admin can reach customer files and the database in one place:
user_files/
accounts/ # per-customer hosting files (MP_ACCOUNT_ROOT)
u000001/
account.json
domains/<domain>/public_html/
databases/ mail/ backups/ ssl/ git/ .runtime/
data/ # control-plane database (MP_DATA_DIR)
mangopanel.sqlite3
Override the location with MP_USER_FILES_DIR (or the more specific MP_ACCOUNT_ROOT / MP_DATA_DIR / MP_DB_PATH). user_files/ is git-ignored. make dev-reset deletes it for a clean slate.
Because all control-plane database records, hosting account files, mailboxes, database stacks, and environment configuration live inside the user_files/ directory (with .env supported at user_files/.env), migrating MangoPanel from one server to another is fast and self-contained.
Stop the panel service and background agent worker on the old server to prevent database writes during transfer:
bash scripts/service mangopanel stopClean clone or install MangoPanel on the target server:
git clone https://github.com/servermango/MangoPanel.git MangoPanel && cd MangoPanel && bash scripts/install.sh
make installCopy the entire user_files/ directory from the source server to the destination server using rsync or scp. This moves:
- Environment & Secrets:
user_files/.env(includesMP_JWT_SECRET) - Control-Plane Database:
user_files/data/mangopanel.sqlite3 - Customer Hosting Files & Mailboxes:
user_files/accounts/
rsync -avzP /path/to/old/MangoPanel/user_files/ root@new-server-ip:/path/to/new/MangoPanel/user_files/Important
If your .env file is at the project root instead of user_files/.env, ensure you also copy .env to the new server. Preserving MP_JWT_SECRET is required so stored encrypted secrets (Cloudflare tokens, registrar API keys) can be decrypted on the new server.
On the destination server, restart the MangoPanel service wrapper and launch container stacks for all hosting accounts:
cd MangoPanel
bash scripts/service mangopanel start
# Provisions and starts Docker containers for all hosting accounts
python3 -c "from mangopanel.config import Config; from mangopanel.agent import Agent; Agent(Config()).run_all()"Point your server domain nameservers or public A-records to the destination server's IP address.
Run the setup checks:
make dev-initStart the local panel only:
make dev-upThis is the fast API-first path. It brings up the client/admin panels and runs the agent in simulated mode, so it writes stack files and state but does not launch the per-account Docker containers.
Start the full local hosting stack:
make dev-up-dockerThis is the recommended path when you want the complete dev environment, including File Manager, phpMyAdmin, per-account web stacks, mail services, and the local PowerDNS container. It requires Docker Desktop to be running.
Open:
- Client: http://127.0.0.1:8000/
- Admin: http://127.0.0.1:8001/admin
- Status: http://127.0.0.1:8000/status
Seed credentials:
- Admin:
admin@mango.test - Customer:
owner@example.mango.test - Password:
ChangeMe-DevOnly-123! - TOTP code in dev mode:
000000
Client signup:
- Open http://127.0.0.1:8000/signup
- The page calls
POST /api/public/signup - The API returns a TOTP secret and creates an initial hosting account when a plan and node are available
First admin setup:
- If the database has zero admins,
/adminon the admin port shows the first-admin setup page - The setup page calls
POST /api/public/admin-setup - After creation, the page shows the TOTP
otpauth://URI, a QR code, the raw secret, and a code check field so you can verify the authenticator entry before logging in - Once an admin exists, first-admin setup is locked
- Existing admins can add more admins from the admin dashboard
Admin recovery and 2FA management:
- The admin dashboard includes controls to change an admin password and enable or disable TOTP for each admin account
- When you create a new admin in the dashboard, MangoPanel shows the TOTP URI, a QR code, the raw secret, and a quick code validation field
- If you need root-level recovery on the server, use
scripts/admin_recovery.py:
sudo python3 scripts/admin_recovery.py --email admin@example.com --set-password
sudo python3 scripts/admin_recovery.py --email admin@example.com --enable-totp
sudo python3 scripts/admin_recovery.py --email admin@example.com --disable-totp--set-passwordchanges the admin password--enable-totpgenerates a new TOTP secret and prints the secret plus QR setup URI--disable-totpclears the admin TOTP secret
Run tests:
make test Run the API smoke test while the dev server is running:
make dev-smokeRun queued agent jobs manually:
make dev-agentThe development server uses MP_AGENT_INLINE=true by default, so API-created jobs are processed immediately in simulated mode. Generated account stack files are written under user_files/accounts/u000001/ unless MP_ACCOUNT_ROOT is changed. See Data Layout for the full directory map.
If you start the full system with make dev-up-docker, it brings up the per-account Docker stack in the same process. Then, in another terminal:
make dev-hosting-smokeThe local Docker stack exposes:
- Website:
http://127.0.0.1:18010 - Filebrowser:
http://127.0.0.1:18011 - phpMyAdmin:
http://127.0.0.1:18012 - Mail web UI:
http://mail-u000001.localhost/webmail - SMTP submission:
127.0.0.1:587 - SMTPS:
127.0.0.1:465 - IMAP:
127.0.0.1:143 - IMAPS:
127.0.0.1:993 - POP3:
127.0.0.1:110 - POP3S:
127.0.0.1:995 - ManageSieve:
127.0.0.1:4190 - MariaDB:
127.0.0.1:18014 - SFTP:
127.0.0.1:18015
Additional accounts get their own port range.
Optional local authoritative DNS for the Docker compose profile is provided by mangopanel-dns, a PowerDNS Authoritative container with its API exposed on http://127.0.0.1:8081/api/v1 and DNS on 127.0.0.1:5353. The panel container is preconfigured to publish managed zones to this service through MP_POWERDNS_API_URL and MP_POWERDNS_API_KEY.
Reset local data:
make dev-resetmake dev-up is the lightweight dev target and is best for panel/API work. If you want the full per-account stack, use make dev-up-docker instead.
The initial compose file runs the panel container:
docker compose -f docker-compose.dev.yml up --buildTo let the agent apply generated account stacks with Docker Compose instead of only writing files:
MP_AGENT_MODE=docker make dev-agentKeep the default simulate mode for fast M1 development. Docker mode may pull large third-party images and should be tested separately.
- Add DNSSEC controls, scheduled background nameserver verification, and production deployment docs for public port 53.
- Implement the shared mail edge from
Project.mdwith mailbox CRUD, MX/inbound routing, SPF/DKIM/DMARC, SMTP/POP/IMAP/JMAP, one-click webmail launch from the client panel, and independent per-mailbox webmail login URLs. - Add browser E2E tests for the client/admin/status pages.
- Add the Linux quota test profile for real storage and inode enforcement.
- Harden Docker mode with image pinning, health checks, and per-service secrets.
The first two implementation steps belong together, so the cleanest way to land them is to treat them as one small program split into three passes.
Phase 1: Shared interfaces and control-plane schema — implemented
- Add provider interfaces for DNS, ACME, and mail-edge routing so the local development adapters and production adapters share the same contract.
- Extend the control-plane schema for managed zones, certificate state, mailbox routing metadata, and mailbox-scoped launch tokens.
- Add seed data and fixtures for one managed domain, one certificate target, and one mailbox/domain pair that exercises the new flow end to end.
- Keep current routes, payloads, and UI fields intact while the new paths are introduced.
Phase 2: Local providers and mail edge — implemented
- Implement the local DNS provider and local ACME provider so the dev stack can create zones, issue certificates, and renew them through the same API used in production.
- Implement the shared mail edge so mailbox CRUD, MX/inbound routing, SPF/DKIM/DMARC, SMTP submission, POP/IMAP, JMAP, and webmail launch all share one routing manifest.
- Wire the client panel to display provider state, routing state, and launch URLs without exposing low-level provider details.
- Add the first browser/API smoke coverage for DNS lookup, certificate issuance, mailbox launch, and direct mailbox login.
Phase 3: Hardening and promotion — implemented
- Verify the browser and API flows on the local stack before marking either step complete.
- Add unauthorized, ownership, bad-input, and security-abuse coverage for every new route and job.
- Keep the implementation additive until the API, agent, and UI all agree on the native workflow.
- Only flip the checklist items after the local providers are stable and the smoke tests pass repeatedly.















