This is an opionated installation procedure for x-ui using ansible
This playbook:
- Installs some tools like htop, iperf3, etc...
- Installs and configures certbot for automatic cert renewal
- Installs docker with docker compose plugin
- Installs x-ui from alireza0
- Automatically configures x-ui: script updates panel port, panel url, admin password, initial xray-config with my personal preferences like blocking connection to Russia, etc
- Configures telegram notifications
First of all, install ansible and external roles:
ansible-galaxy role install geerlingguy.certbot
ansible-galaxy role install geerlingguy.docker
Change variables inside of playbook.yml
. Especially xui_hostname
and certbot domain and admin email:
variable | description |
---|---|
certbot_admin_email | your email address |
certbot_certs.email | your email address |
certbot_certs.domains | your domain |
xui_hostname | your domain |
socks_username (inside secrets file) | username for socks5 proxy |
socks_password (inside secrets file) | password for socks5 proxy |
Change inventory in inventory.ini
: fill IP address of your VPS
Set up secrets for telegram:
- Copy
secrets_file.enc.template
tosecrets_file.enc
- Fill you telegram bot token - can be obtained from @botfather
- Fill you id - can be obtained from @userinfobot
- Execute
ansible-vault encrypt secrets_file.enc
and set your password
Run playbook:
ansible-playbook -i inventory.ini playbook.yaml -e @secrets_file.enc --ask-vault-pass
You will be asked for password. Use password for encrypted secrets storage
Panel url and credentials will be shown in the output of the ansible script:
Panel should be fully ready to configure inbounds. Select your desired domain for masking and start using VPN :)