A comprehensive web-based administration interface for managing 3proxy proxy servers. Built with Next.js, React, and TypeScript, this UI provides intuitive controls for user management, traffic monitoring, configuration, and system observability.
| Home | Login | Dashboard |
|---|---|---|
![]() |
![]() |
![]() |
| Users List | Create User | Profile |
|---|---|---|
![]() |
![]() |
![]() |
| Home | Login | Dashboard |
|---|---|---|
![]() |
![]() |
![]() |
| Users List | Create User | Profile |
|---|---|---|
![]() |
![]() |
![]() |
| Home | Login | Dashboard |
|---|---|---|
![]() |
![]() |
![]() |
| Users List | Create User | Profile |
|---|---|---|
![]() |
![]() |
![]() |
- User Management: Create, edit, and deactivate proxy users with data limits and expiration dates
- Traffic Monitoring: Real-time bandwidth usage tracking and analytics
- Authentication System: Secure login with JWT-based sessions and role-based access control
- Configuration Management: View and modify 3proxy settings through an intuitive interface
- Telegram Integration: Receive notifications for account deactivations and system events
- Docker Support: Easy deployment with Docker and Docker Compose
- RESTful API: Well-documented API for programmatic access and integration
- Observability: Built-in logging, metrics, and health checks
- Responsive Design: Works on desktop and mobile devices
- Framework: Next.js 16.2+ with React 19.1+
- UI Library: HeroUI for accessible, beautiful components
- Styling: Tailwind CSS 4.2+ with Tailwind Variants
- Form Handling: React Hook Form
- Icons: Lucide React
- QR Code Generation: QR Code Styling
- Runtime: Node.js 20+ with TypeScript
- ORM: Prisma 6.19+ with SQLite
- Authentication: JWT (HS256) via jsonwebtoken, stored in an HttpOnly cookie
- Password Hashing: Bcrypt for panel accounts, Unix
cryptfor 3proxy proxy accounts - Scheduling: Node-cron for the recurring maintenance job
- Validation: Zod for server-side configuration validation
- API Routes: Next.js API routes for RESTful endpoints
- Containerization: Docker with multi-architecture support (amd64, arm64), published as a single multi-arch manifest
- CI/CD: GitHub Actions for automated testing and deployment
- Testing: Jest (unit, integration and fail2ban config projects) plus an E2E suite that drives real traffic through 3proxy in Docker Compose
- Code Quality: ESLint with Prettier formatting
- Type Safety: TypeScript 5.6+ with strict mode
- Build Tools: TSX, TSC-Alias
3proxy-ui/
├── src/
│ ├── app/ # Next.js app router
│ │ ├── api/ # API routes (auth, users, config, logs, etc.)
│ │ ├── admin/ # Admin dashboard and user management
│ │ ├── login/ # Authentication pages
│ │ └── ... # Other pages
│ ├── components/ # Reusable UI components
│ │ ├── modals/ # Dialog components
│ │ └── users-list/ # User table and actions
│ ├── core/ # Session, config, logging, scheduler, system info
│ │ └── actions/ # Server actions (admin, config)
│ ├── hooks/ # Custom React hooks
│ ├── lib/ # Parsers and integrations (traffic, logs, Telegram)
│ ├── prisma/ # Prisma client instance
│ ├── styles/ # Global styles and fonts
│ ├── types/ # Shared TypeScript types
│ └── proxy.ts # Next.js middleware
├── 3proxy/ # 3proxy configs, logs and the .proxyauth file
├── data/ # Runtime data (traffic sync state, SQLite database)
├── prisma/ # Prisma schema and migrations
├── public/ # Static assets
├── scripts/ # Build, setup, start and maintenance scripts
└── tests/ # Jest projects (unit, integration, fail2ban) and E2E suites
- Node.js 20.x or later
- Docker and Docker Compose (for containerized deployment)
- Git
A database is not required for local development: Prisma uses SQLite, and the schema is applied with a migration.
-
Clone the repository
git clone https://github.com/aekozhevnikov/3proxy-ui.git cd 3proxy-ui -
Install dependencies
npm install
-
Set up environment variables
cp .env.example .env # Edit .env with your configuration -
Initialize the database and the admin account
npx prisma migrate deploy npx prisma generate npm run compile # `npm run setup` runs the compiled script npm run setup -
Start the development server
npm run dev
-
Access the application Open http://localhost:3000 in your browser
The image ships the panel, fail2ban and the Docker CLI — but not 3proxy itself. The panel is a control plane for a separate 3proxy instance, so a working deployment needs both containers sharing a config volume, plus the Docker socket for configuration reloads. The compose file in this repository wires that together:
cp .env.example .env # set JWT_SECRET, at least 32 characters
docker compose up -dThe full reference, including every environment variable, is in DOCKER.md.
Running the panel on its own works for a first look, but it needs the 3proxy log volume or fail2ban has nothing to watch:
docker run -d \
--name 3proxy-ui \
-p 3000:3000 \
-e JWT_SECRET="your-secret-at-least-32-characters-long" \
-e PROXY_DOMAIN="proxy.example.com" \
-e LOGS_DIR=/etc/3proxy/logs \
-e PROXYAUTH_PATH=/etc/3proxy/users/.proxyauth \
-v 3proxy-data:/app/data \
-v ./3proxy:/etc/3proxy \
aekozh/3proxy-ui:latestThe published image is a multi-arch manifest and runs natively on both linux/amd64 and
linux/arm64 — no emulation involved.
Default credentials (change immediately after first login):
- Username:
admin - Password:
admin
Copy .env.example to .env and adjust the following key variables:
| Variable | Description | Default |
|---|---|---|
DATABASE_URL |
SQLite connection string | file:/app/data/app.db in the image, set by the entrypoint |
JWT_SECRET |
HS256 signing key for session cookies, minimum 32 characters | (required) |
APP_URL |
Public base URL of the panel | http://localhost:3000 |
APP_NAME |
Panel title | 3proxy UI |
APP_DESCRIPTION |
Panel description | Admin panel for 3proxy |
TELEGRAM_BOT_TOKEN |
Telegram bot token for notifications | (optional) |
LOGS_DIR |
Directory containing 3proxy logs | ./3proxy/logs |
PROXYAUTH_PATH |
Path to the 3proxy .proxyauth file |
./3proxy/users/.proxyauth |
TRAFFIC_SYNC_INTERVAL |
Cron schedule for the maintenance job | */30 * * * * (every 30 minutes) |
SYNC_INFO_FILE |
Where per-inode log offsets are stored | ./data/traffic-sync.json |
LOG_LEVEL |
Application log verbosity: debug, info, warn, error |
info |
ENABLE_FAIL2BAN |
Start fail2ban in the container | true |
ADMIN_USERNAME / ADMIN_PASSWORD |
Seeded on first start if no admin exists | admin / admin |
The proxy ports are baked in at build time from HTTP_PORT (3128), SOCKS_PORT (1080) and
PROXY_DOMAIN, and exposed to the browser through the matching NEXT_PUBLIC_* variables.
The UI expects a running 3proxy instance with:
- JSON logging enabled, so traffic can be derived from the log
- A
.proxyauthfile for user authentication - Access to log files for traffic analysis
In a container, the 3proxy config directory has to be shared with the panel, and the paths have to
be pointed at explicitly. The panel reads LOGS_DIR and PROXYAUTH_PATH, which default to
/app/3proxy/logs and /app/3proxy/users/.proxyauth — a directory the image does not ship, so
without those variables traffic accounting silently reads nothing. The Docker socket is needed as
well, because reloading the configuration restarts the 3proxy container through the Docker API.
Traffic is accounted by reading new log entries incrementally and persisting a byte offset per file, so repeated syncs do not double-count.
See the 3proxy documentation for server setup instructions.
POST /api/auth/login- User loginPOST /api/auth/logout- User logoutPOST /api/auth/change-credentials- Change passwordGET /api/auth/session- Check session status
GET /api/admin/users- List all usersGET /api/admin/users/[id]- Get a single userPUT /api/admin/users/[id]- Update a userDELETE /api/admin/users/[id]- Delete a userPOST /api/admin/users/test-proxy- Check proxy reachabilityPOST /api/users/maintenance- Run traffic sync and maintenance
GET /api/system/status- Get system status (3proxy, users, logs)GET /api/config/status- Get the current 3proxy configurationGET /api/config/generate- Render the generated user configuration as JSONPOST /api/config/generate- Write the generated user configuration toPROXYAUTH_PATHPOST /api/config/reload- Restart the 3proxy container through the Docker APIGET /api/proxy-config- Get proxy configurationGET /api/logs- Get recent log entriesGET /api/users/traffic- Get user traffic statisticsGET /api/health- Health check endpoint
A single recurring job is scheduled by startBackgroundTasks() in src/core/scheduler.ts. It runs
traffic synchronization and cleanup on the TRAFFIC_SYNC_INTERVAL cron schedule, and once at
startup. The same work is exposed on demand through POST /api/users/maintenance.
The application uses Prisma ORM with SQLite and the following models:
- User: Panel accounts, with an
isAdminflag - Server: Known 3proxy servers, their address, port and optional management API credentials
- ProxyUser: Proxy credentials, data limits, used traffic, IP limit, expiry and deactivation state
- ConfigVersion: Revision history of the generated 3proxy configuration
Traffic counters are stored as BigInt and mapped to data_used, in megabytes.
Run npx prisma studio to visualize and manage the database.
npm run test:unitnpm run test:integrationnpm run test:fail2banThe E2E suite builds the image and runs it through docker-compose.dev.yml, driving real traffic
through 3proxy:
npm run test:e2e
npm run test:e2e:traffic # traffic limit assertions
npm run test:e2e:fail2ban # fail2ban blocking assertionsnpm run test:allThe project includes:
- Unit tests for utility functions and API routes
- Integration tests that run against a real migrated SQLite database
- E2E tests covering traffic accounting and fail2ban blocking
The deployment shapes are documented once, in DOCKER.md, and kept in sync with the two compose files in this repository:
docker-compose.yml— the reference stack: 3proxy plus the paneldocker-compose.dev.yml— the same stack on a different port, used by the E2E suitetests/e2e/docker-compose.e2e.ymlandtests/e2e/docker-compose.fail2ban.yml— E2E variants
To build the image locally:
docker build -t 3proxy-ui .- Application logs go to the container output, with verbosity controlled by
LOG_LEVEL - The maintenance runner uses its own helper that adds a
successlevel for job summaries - 3proxy logs are read from
LOGS_DIR, not written by the panel
- Built-in metrics collection for:
- API response times
- Database query performance
- Background job execution
- User authentication events
- Exportable via Prometheus (work in progress)
/api/health- Liveness and readiness probes/api/system/status- 3proxy process, user counts and log status- Database connectivity checks
- Disk space monitoring
- Authentication: HS256 JWT in an HttpOnly cookie, verified against a fixed audience and issuer
- Authorization: Admin flag on the panel
Usermodel - Input Validation: Server-side validation with Zod
- Password Security: Bcrypt for panel accounts; 3proxy proxy accounts are stored as Unix
crypthashes, because that is the format 3proxy's.proxyauthfile requires - Session Management: Session cookies expire after one hour and are cleared on logout and password change
- Environment Secrets: Sensitive data stored in environment variables
- Brute-force Protection: Optional fail2ban jails for the proxy ports
Note that the Docker socket is mounted read-write so that configuration reloads can restart the 3proxy container. That is equivalent to root on the host, so the panel should sit behind authentication and ideally a TLS-terminating reverse proxy.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- 3proxy - The powerful proxy server being managed
- HeroUI - Beautiful, accessible UI components
- Next.js - The React framework for production
- Prisma - Modern ORM for Node.js and TypeScript
- Tailwind CSS - Utility-first CSS framework
- All contributors and users of this project
For issues, questions, or feature requests:
- Check the existing issues
- Open a new issue with detailed information
Planned features for future releases:
- Real-time WebSocket dashboard for live traffic monitoring
- Advanced analytics and reporting
- LDAP/Active Directory integration
- SAML/OAuth2 authentication providers
- Automated backup and restore functionality
- Multi-tenancy support
- Plugin architecture for extensibility
- Enhanced observability with Grafana dashboards
- Automated SSL certificate management (Let's Encrypt)

















