mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[PR #5632] [CLOSED] feat(deploy): add Ansible role for automated 3x-ui installation #5940
Labels
No labels
backlog
bug
clarification needed
documentation
duplicate
enhancement
github_actions
good first issue
invalid
javascript
New Feature
PR welcomed
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MHSanaei/3x-ui#5940
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/MHSanaei/3x-ui/pull/5632
Author: @alchkalbasi
Created: 6/28/2026
Status: ❌ Closed
Base:
main← Head:feat/ansible-deployment📝 Commits (1)
9f89157feat(deploy): add Ansible role for automated 3x-ui installation📊 Changes
21 files changed (+1074 additions, -0 deletions)
View changed files
➕
ansible/.gitignore(+2 -0)➕
ansible/README.md(+83 -0)➕
ansible/inventories/hosts.sample.yml(+9 -0)➕
ansible/playbook.yml(+8 -0)➕
ansible/roles/install-3x-ui/defaults/main.yml(+56 -0)➕
ansible/roles/install-3x-ui/handlers/main.yml(+11 -0)➕
ansible/roles/install-3x-ui/tasks/configure.yml(+115 -0)➕
ansible/roles/install-3x-ui/tasks/database.yml(+92 -0)➕
ansible/roles/install-3x-ui/tasks/install.yml(+218 -0)➕
ansible/roles/install-3x-ui/tasks/main.yml(+44 -0)➕
ansible/roles/install-3x-ui/tasks/prerequisites.yml(+149 -0)➕
ansible/roles/install-3x-ui/tasks/service.yml(+56 -0)➕
ansible/roles/install-3x-ui/tasks/ssl.yml(+157 -0)➕
ansible/roles/install-3x-ui/templates/install-result.env.j2(+10 -0)➕
ansible/roles/install-3x-ui/templates/x-ui-db.env.j2(+6 -0)➕
ansible/roles/install-3x-ui/templates/x-ui-panel.env.j2(+7 -0)➕
ansible/roles/install-3x-ui/templates/x-ui.rc.j2(+18 -0)➕
ansible/roles/install-3x-ui/templates/x-ui.service.j2(+19 -0)➕
ansible/roles/install-3x-ui/vars/Debian.yml(+6 -0)➕
ansible/roles/install-3x-ui/vars/RedHat.yml(+6 -0)...and 1 more files
📄 Description
Hi.
I put together an Ansible setup for 3x-ui to make deploying and managing the panel a lot easier, especially for folks running multiple nodes.
The current shell script is great for single servers, but managing things across a cluster manually gets tricky. I wanted to provide a way to automate the whole stack.
Why this helps:
No more manual setups: You can spin up identical panel nodes from scratch without running through the steps by hand every time.
Handles the annoying stuff: It automatically takes care of firewall rules (like firewalld) and Let's Encrypt SSL via acme.sh so you don't have to mess with port 80 routing manually.
Safe to rerun: It's idempotent. You can run the playbook again to update configs or fix a broken state without worrying about wiping the SQLite database or dropping active Xray tunnels.
What's inside:
inventory.sample.yml: A quick template for users to define their servers.
playbook.yml: The main entry point to kick off the deployment.
roles/install-3x-ui/: The actual automation logic (handles prerequisites, pulling binaries, SSL, and creating the systemd service).
Testing
I built and tested this primarily on Debian-based systems (Debian 12 and Ubuntu 20.04 - 24.04). The Xray-core service initializes perfectly under systemd and the web UI spins up without issues.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.