Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
M

Marzban

> 编程语言
Open source

Unified GUI Censorship Resistant Solution Powered by Xray

7.3K stars0 likes2 views
WebsiteGitHub

About

Unified GUI Censorship Resistant Solution Powered by Xray

</picture>

Marzban

Unified GUI Censorship Resistant Solution Powered by Xray


</a>
<a href="https://hub.docker.com/r/gozargah/marzban" target="_blank">
    
</a>
<a href="#">
    
</a>
<a href="https://t.me/gozargah_marzban" target="_blank">
    
</a>
<a href="#">
    
</a>
<a href="#">
    
</a>

English / فارسی / 简体中文 / Русский

Table of Contents

  • Overview
    • Why using Marzban?
      • Features
  • Installation guide
  • Configuration
  • Documentation
  • API
  • Backup
  • Telegram Bot
  • Marzban CLI
  • Marzban Node
  • Webhook notifications
  • Donation
  • License
  • Contributors

Overview

Marzban (the Persian word for "border guard" - pronounced /mærz'ban/) is a proxy management tool that provides a simple and easy-to-use user interface for managing hundreds of proxy accounts powered by Xray-core and built using Python and Reactjs.

Why using Marzban?

Marzban is user-friendly, feature-rich and reliable. It lets you to create different proxies for your users without any complicated configuration. Using its built-in web UI, you are able to monitor, modify and limit users.

Features

  • Built-in Web UI
  • Fully REST API backend
  • Multiple Nodes support (for infrastructure distribution & scalability)
  • Supports protocols Vmess, VLESS, Trojan and Shadowsocks
  • Multi-protocol for a single user
  • Multi-user on a single inbound
  • Multi-inbound on a single port (fallbacks support)
  • Traffic and expiry date limitations
  • Periodic traffic limit (e.g. daily, weekly, etc.)
  • Subscription link compatible with V2ray (such as V2RayNG, SingBox, Nekoray, etc.), Clash and ClashMeta
  • Automated Share link and QRcode generator
  • System monitoring and traffic statistics
  • Customizable xray configuration
  • TLS and REALITY support
  • Integrated Telegram Bot
  • Integrated Command Line Interface (CLI)
  • Multi-language
  • Multi-admin support (WIP)

Installation guide

Run the following command to install Marzban with SQLite database:

bash
sudo bash -c "$(curl -sL https://github.com/Gozargah/Marzban-scripts/raw/master/marzban.sh)" @ install

Run the following command to install Marzban with MySQL database:

bash
sudo bash -c "$(curl -sL https://github.com/Gozargah/Marzban-scripts/raw/master/marzban.sh)" @ install --database mysql

Run the following command to install Marzban with MariaDB database:

bash
sudo bash -c "$(curl -sL https://github.com/Gozargah/Marzban-scripts/raw/master/marzban.sh)" @ install --database mariadb

Once the installation is complete:

  • You will see the logs that you can stop watching them by closing the terminal or pressing Ctrl+C
  • The Marzban files will be located at /opt/marzban
  • The configuration file can be found at /opt/marzban/.env (refer to configurations section to see variables)
  • The data files will be placed at /var/lib/marzban
  • For security reasons, the Marzban dashboard is not accessible via IP address. Therefore, you must obtain SSL certificate and access your Marzban dashboard by opening a web browser and navigating to https://YOUR_DOMAIN:8000/dashboard/ (replace YOUR_DOMAIN with your actual domain)
  • You can also use SSH port forwarding to access the Marzban dashboard locally without a domain. Replace user@serverip with your actual SSH username and server IP and Run the command below:
bash
ssh -L 8000:localhost:8000 user@serverip

Finally, you can enter the following link in your browser to access your Marzban dashboard:

http://localhost:8000/dashboard/

You will lose access to the dashboard as soon as you close the SSH terminal. Therefore, this method is recommended only for testing purposes.

Next, you need to create a sudo admin for logging into the Marzban dashboard by the following command

bash
marzban cli admin create --sudo

That's it! You can login to your dashboard using these credentials

To see the help message of the Marzban script, run the following command

bash
marzban --help

If you are eager to run the project using the source code, check the section below

Manual install (advanced)

Install xray on your machine

You can install it using Xray-install

bash
bash -c "$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)" @ install

Clone this project and install the dependencies (you need Python >= 3.8)

bash
git clone https://github.com/Gozargah/Marzban.git
cd Marzban
wget -qO- https://bootstrap.pypa.io/get-pip.py | python3 -
python3 -m pip install -r requirements.txt

Alternatively, to have an isolated environment you can use Python Virtualenv

Then run the following command to run the database migration scripts

bash
alembic upgrade head

If you want to use marzban-cli, you should link it to a file in your $PATH, make it executable, and install the auto-completion:

bash
sudo ln -s $(pwd)/marzban-cli.py /usr/bin/marzban-cli
sudo chmod +x /usr/bin/marzban-cli
marzban-cli completion install

Now it's time to configuration

Make a copy of .env.example file, take a look and edit it using a text editor like nano.

You probably like to modify the admin credentials.

bash
cp .env.example .env
nano .env

Check configurations section for more information

Eventually, launch the application using command below

bash
python3 main.py

To launch with linux systemctl (copy marzban.service file to /var/lib/marzban/marzban.service)

systemctl enable /var/lib/marzban/marzban.service
systemctl start marzban

To use with nginx

…

or

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    server_name  marzban.example.com;

    ssl_certificate      /etc/letsencrypt/live/example.com/fullchain.pem;
    ssl_certificate_key  /etc/letsencrypt/live/example.com/privkey.pem;

    location / {
        proxy_pass http://0.0.0.0:8000;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
}

By default the app will be run on http://localhost:8000/dashboard. You can configure it using changing the UVICORN_HOST and UVICORN_PORT environment variables.

Configuration

You can set settings below using environment variables or placing them in .env file.

Variable Description
SUDO_USERNAME Superuser's username
SUDO_PASSWORD Superuser's password
SQLALCHEMY_DATABASE_URL Database URL (SQLAlchemy's docs)
UVICORN_HOST Bind application to this host (default: 0.0.0.0)
UVICORN_PORT Bind application to this port (default: 8000)
UVICORN_UDS Bind application to a UNIX domain socket
UVICORN_SSL_CERTFILE SSL certificate file to have application on https
UVICORN_SSL_KEYFILE SSL key file to have application on https
UVICORN_SSL_CA_TYPE Type of authority SSL certificate. Use private for testing self-signed CA (default: public)
XRAY_JSON Path of Xray's json config file (default: xray_config.json)
XRAY_EXECUTABLE_PATH Path of Xray binary (default: /usr/local/bin/xray)
XRAY_ASSETS_PATH Path of Xray assets (default: /usr/local/share/xray)
XRAY_SUBSCRIPTION_URL_PREFIX Prefix of subscription URLs
XRAY_FALLBACKS_INBOUND_TAG Tag of the inbound that includes fallbacks, needed in the case you're using fallbacks
XRAY_EXCLUDE_INBOUND_TAGS Tags of the inbounds that shouldn't be managed and included in links by application
CUSTOM_TEMPLATES_DIRECTORY Customized templates directory (default: app/templates)
CLASH_SUBSCRIPTION_TEMPLATE The template that will be used for generating clash configs (default: clash/default.yml)
SUBSCRIPTION_PAGE_TEMPLATE The template used for generating subscription info page (default: subscription/index.html)
HOME_PAGE_TEMPLATE Decoy page template (default: home/index.html)
TELEGRAM_API_TOKEN Telegram bot API token (get token from @botfather)
TELEGRAM_ADMIN_ID Numeric Telegram ID of admin (use @userinfobot to found your ID)
TELEGRAM_PROXY_URL Run Telegram Bot over proxy
JWT_ACCESS_TOKEN_EXPIRE_MINUTES Expire time for the Access Tokens in minutes, 0 considered as infinite (default: 1440)
DOCS Whether API documents should be availab

Issues· 84 open

View all issuesOpen on GitHub
  • #2083

    عوض شدن لینک ساب بعد از ریست مرزبان یا رفرش پنل

    Updated Sep 24, 2026
  • #2095

    Mergen

    Updated Sep 18, 2026
  • #2094

    Mergen

    Updated Sep 18, 2026
  • #2066

    آپدیت شدن لینک ساب با رفرش پنل

    Updated Jul 22, 2026
  • #2085

    Bug title

    Updated Jul 6, 2026
  • #2082

    Bug title

    Updated Jul 5, 2026
  • #2080

    Bug titlehttp://YOUR_SERVER_IP:9000

    Updated Jun 28, 2026
  • #2078

    Bug title

    Updated Jun 23, 2026
  • #2077

    Bug title

    Updated Jun 23, 2026
  • #2076

    Bug title

    Updated Jun 23, 2026

> Tags

Pythonapicensorship-resistantdashboardshadowsocks

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedOct 2, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言