Complete guide for using the config manager with Marzban panel
← Back to Config ManagerMarzban is a web-based Xray management panel that separates configuration management from the core Xray settings.
/opt/marzban/xray_config.json # Xray core configuration
/opt/marzban/.env # Marzban environment variables
/var/lib/marzban/db.sqlite3 # Database (users, nodes)
Method A: Via SSH (Recommended)
# Connect to your VPS
ssh user@your-vps-ip
# View configuration file
cat /opt/marzban/xray_config.json
# Download to local computer (run on local machine)
scp user@your-vps-ip:/opt/marzban/xray_config.json ~/Downloads/
Method B: Via Marzban Panel
xray_config.json file[Warning] Very Important! Always backup first!
# Connect to VPS
ssh user@your-vps-ip
# Backup original configuration
sudo cp /opt/marzban/xray_config.json /opt/marzban/xray_config.json.backup.$(date +%Y%m%d)
# Verify backup
ls -lh /opt/marzban/xray_config.json*
# Upload from local to VPS (run on local machine)
scp ~/Downloads/config_modified.json user@your-vps-ip:/tmp/xray_config_new.json
# On VPS, replace configuration
ssh user@your-vps-ip
sudo mv /tmp/xray_config_new.json /opt/marzban/xray_config.json
# Set correct permissions
sudo chown marzban:marzban /opt/marzban/xray_config.json
sudo chmod 644 /opt/marzban/xray_config.json
# Validate JSON syntax before restart
cat /opt/marzban/xray_config.json | python3 -m json.tool > /dev/null
# If no output, the format is correct
# If there's an error, it will show the exact location
# Go to Marzban directory
cd /opt/marzban
# Restart service
sudo docker-compose restart
# Or restart only Xray core
sudo docker-compose exec marzban xray api restart
# View container status
sudo docker-compose ps
# View logs (check for errors)
sudo docker-compose logs -f --tail=50
# Press Ctrl+C to exit log view
# Check if Xray is running properly
sudo docker-compose exec marzban ps aux | grep xray
Test on client side:
# Test Instagram resolution
nslookup i.instagram.com
# Test Wikipedia resolution
nslookup en.wikipedia.org
# Access through proxy (make sure connected)
curl -I https://i.instagram.com
curl -I https://www.wikipedia.org
The config manager automatically adds the following to your configuration:
{
"dns": {
"servers": [
{
"address": "100.100.100.100",
"port": 53,
"domains": [
"full:i.instagram.com",
"full:www.instagram.com",
"domain:wikipedia.org"
],
"expectIPs": ["geoip:private"],
"skipFallback": true
},
"8.8.8.8",
"1.1.1.1"
],
"queryStrategy": "UseIP"
}
}
{
"routing": {
"domainStrategy": "IPIfNonMatch",
"rules": [
{
"type": "field",
"domain": [
"full:i.instagram.com",
"full:www.instagram.com",
"domain:wikipedia.org"
],
"outboundTag": "direct"
},
{
"type": "field",
"ip": ["100.64.0.0/10"],
"outboundTag": "direct"
}
]
}
}
If you later modify configuration through Marzban web interface, some versions may overwrite manual edits.
A: Immediately restore backup:
# Restore backup
sudo cp /opt/marzban/xray_config.json.backup.* /opt/marzban/xray_config.json
# Restart service
cd /opt/marzban
sudo docker-compose restart
A: Test on VPS:
# Enter Marzban container
sudo docker-compose exec marzban bash
# Test DNS resolution
nslookup i.instagram.com 100.100.100.100
# Should return private IP (100.64.x.x)
A: No, but note:
xray_config.jsonA: No:
xray_config.json onceConfiguration File: /opt/marzban/xray_config.json
Restart Command: cd /opt/marzban && sudo docker-compose restart
View Logs: sudo docker-compose logs -f
Backup Command: sudo cp /opt/marzban/xray_config.json /opt/marzban/xray_config.json.backup.$(date +%Y%m%d)
Need help? Report an issue