Hosted bot: @vpn_xray_by_pheezz_bot
- Ubuntu 23.04 LTS
RAM: 2GB
CPU core: 1
Storage: 30GB
- Ubuntu 20.04 LTS
RAM: 2GB
CPU core: 2
Storage: 40GB
{
"log": {
"loglevel": "info"
},
"routing": {
"rules": [],
"domainStrategy": "AsIs"
},
"inbounds": [
{
"port": 443,
"protocol": "vless",
"tag": "vless_tls",
"settings": {
"clients": [],
"decryption": "none"
},
"streamSettings": {
"network": "tcp",
"security": "reality",
"realitySettings": {
"show": false,
"dest": "dl.google.com:443", < anything else if you know to do
"xver": 0,
"serverNames": [
"dl.google.com" < anything else if you know to do
],
"privateKey": "<your private key>", < openssl genpkey -algorithm x25519 -out x25519-priv.pem
"minClientVer": "",
"maxClientVer": "",
"maxTimeDiff": 0,
"shortIds": [
"<your short id>" < openssl rand -hex 8
]
}
},
"sniffing": {
"enabled": true,
"destOverride": [
"http",
"tls"
]
}
}
],
"outbounds": [
{
"protocol": "freedom",
"tag": "direct"
},
{
"protocol": "blackhole",
"tag": "block"
}
]
}
docker compose up -d --build
wget https://raw.githubusercontent.com/PheeZz/XTLS-Reality-bot/main/autoinstall.sh && chmod +x autoinstall.sh && ./autoinstall.sh
git, curl, postgres
sudo apt install -y git curl postgresql postgresql-contrib
systemctl start postgresql.service
python 3.11, pip, poetry
sudo apt install -y software-properties-common
add-sudo apt-repository ppa:deadsnakes/ppa
sudo apt update
sudo apt install -y python3.11 python3.11-dev python3.11-distutils python3.11-venv
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python3.11 get-pip.py
pip3.11 install poetry
XRAY (or you can install it with not default options, follow this guide)
bash -c "$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)" @ install
/usr/local/bin/xray x25519
Output will be something like:
Private key: CJcqQtcklhCMfiFW8A4BA0XsgKmRJk4-_l42bpnVn0I
Public key: JjAXPY-s2FkvVypfGN2c71NQsCW489Vxjtayo6hLmVM
openssl rand -hex 8
Output will be something like:
0ed36d458733a0bc
Path:
/usr/local/etc/xray/config.json
config.json
{
"log": {
"loglevel": "info"
},
"routing": {
"rules": [],
"domainStrategy": "AsIs"
},
"inbounds": [
{
"port": 443,
"protocol": "vless",
"tag": "vless_tls",
"settings": {
"clients": [],
"decryption": "none"
},
"streamSettings": {
"network": "tcp",
"security": "reality",
"realitySettings": {
"show": false,
"dest": "dl.google.com:443",
"xver": 0,
"serverNames": [
"dl.google.com"
],
"privateKey": "<your private key>",
"minClientVer": "",
"maxClientVer": "",
"maxTimeDiff": 0,
"shortIds": [
"<your short id>"
]
}
},
"sniffing": {
"enabled": true,
"destOverride": [
"http",
"tls"
]
}
}
],
"outbounds": [
{
"protocol": "freedom",
"tag": "direct"
},
{
"protocol": "blackhole",
"tag": "block"
}
]
}
restart xray service
systemctl restart xray.service
To increase performance, you can configure Bottleneck Bandwidth and Round-trip propagation time (BBR) congestion control algorithm on the server
echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf
echo "net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf
sysctl -p
enter psql shell
sudo -u postgres psql
create user and database
CREATE DATABASE <database_name>;
CREATE USER <user_name> WITH PASSWORD '<password>';
GRANT ALL PRIVILEGES ON DATABASE <database_name> TO <user_name>;
GRANT ALL ON ALL TABLES IN SCHEMA "public" TO <user_name>;
in case of some errors with permission you can make user superuser
ALTER USER <user_name> WITH SUPERUSER;
exit psql shell
\q
git clone https://github.com/PheeZz/XTLS-Reality-bot.git
cd XTLS-Reality-bot
poetry install
nano source/data/.env
#telegram bot token
TG_BOT_TOKEN = "<token>"
#your bank card number, if you will use payments with "handmade" method
PAYMENT_CARD = "<card in string format>"
#your telegram id, you can get it from @userinfobot or @myidbot or @RawDataBot
ADMINS_IDS = "<id/ids>"
#any text you want to show in the start of every peer config file (for example in case MYVPN_Phone.conf - "MYVPN" is prefix)
CONFIGS_PREFIX = "XrayPheeZzVPN"
#how much subscription costs. example: "100₽", "10$"
BASE_SUBSCRIPTION_MONTHLY_PRICE = "100₽"
DB_NAME = "<your db name>"
DB_USER = "<your db user name>"
DB_USER_PASSWORD = "<your db user password>"
#database host, default localhost
DB_HOST = "localhost"
#database port, default 5432
DB_PORT = "5432"
XRAY_CONFIG_PATH = "/usr/local/etc/xray/config.json"
XRAY_PUBLICKEY = "<public key from step 3.3.1>"
XRAY_SHORTID = "<short id from step 3.3.1>"
XRAY_SNI = "dl.google.com"
#default max configs count for each user (admin can give bonus configs to any user through admin panel)
USER_DEFAULT_MAX_CONFIGS_COUNT = "2"
$(poetry env info --executable) create_database_tables.py
nano /etc/systemd/system/xtls-reality-bot.service
[Unit]
Description=XTLS-Reality telegram bot
After=network.target
[Service]
Type=simple
User=root
ExecStart=/bin/bash -c 'cd ~/XTLS-Reality-bot/ && $(poetry env info --executable) app.py'
Restart=on-failure
[Install]
WantedBy=multi-user.target
systemctl enable xtls-reality-bot.service
systemctl start xtls-reality-bot.service
- On some systems may require to change postgresql database encoding (in case of config names are in any language other than English). StackOverflow: Postgres issue encoding "UTF8" has no equivalent in encoding "LATIN1"
- If some error with XRAY occurred try this guides (RU):
- Bleeding-edge обход блокировок с полной маскировкой: настраиваем сервер и клиент XRay с XTLS-Reality быстро и просто
- 3X-UI: Shadowsocks-2022 & XRay (XTLS) сервер с простой настройкой и приятным интерфейсом
- Обход блокировок: настройка сервера XRay для Shadowsocks-2022 и VLESS с XTLS-Vision, Websockets и фейковым веб-сайтом
You can support me by give ⭐️star to this repo or.. Donation..👉🏼👈🏼