Persian README (راهنمای فارسی)
This script provides an interactive and automated way to install, configure, and manage frp (a fast reverse proxy) on your system. It simplifies the setup of both the frp server (frps) and client (frpc).
You can download and run the script with a single command:
bash <(curl -sSL https://raw.githubusercontent.com/iebu123/frp-installer/main/frp_installer.sh)- Automated Installation/Update: Downloads and installs the latest version of
frpfor your OS and architecture. - Interactive Configuration: Guides you through the process of configuring both
frpsandfrpcwith a user-friendly menu. - Configuration Validation: Verifies the generated configuration files to ensure they are valid.
- Systemd Service Management: Creates and manages
systemdservices forfrpsandfrpc, allowing you to easily start, stop, restart, and check the status of the services. - Automatic Service Reset: Set up a cron job to automatically reset
frpservices daily, weekly, or monthly to ensure they are always running smoothly. - Proxy Management: Easily add and manage proxies for the
frpcclient, with support for single ports and port ranges. - Automatic Proxy Naming: Automatically generates proxy names based on the ports, simplifying the configuration process.
- User-Friendly Interface: A clear and visually appealing menu-driven interface for easy navigation and operation.
- Downloads compiled FRP tunnel files: Saves them to
/usr/local/bin. - Creates configuration files for FRP: These are located in the
/etc/frpdirectory. - Creates systemd services: Launches the tunnel using the generated configurations. The service files are stored in
/etc/systemd/system/frps.servicefor the server and/etc/systemd/system/frpc-<custom_name>.servicefor each client instance. - Dedicated client service files: Each client service is created with a unique name, allowing for independent management and configuration for different server connections.
- (Optional) Automatic Service Reset: Creates a cron job to automatically restart all
frpservices at a specified frequency (daily, weekly, or monthly).
To view the list of created client tunnels, run the following command:
systemctl list-units --type=service | grep frpc-To view the last 50 lines of logs for a service:
- For server:
journalctl -u frps.service -n 50 - For client:
journalctl -u frpc-<client_name>.service -n 50
bashcurlsudoprivilegescron(for the automatic service reset feature)
- Make the script executable:
chmod +x frp_installer.sh
- Run the script:
./frp_installer.sh
To set up your FRP tunnel, follow these steps:
- Install the tunnel (Option 1 in the main menu).
- Configure the server and client (Options 2 and 3 in the main menu):
- First, configure the server (e.g., located inside Iran, China, etc.), then create and start its service.
- Next, configure the client (e.g., on a server outside the country, with no restrictions).
- (Optional) Set up automatic service reset (Option 5 in the main menu) to ensure the services remain active.
To add a second, third, or additional client service for other servers:
- Run again option 3 in main menu: Configure Client (frpc)
The script presents a menu with the following options:
- Install/Update FRP: Installs or updates
frpto the latest version. - Configure Server (frps): Guides you through the process of creating a configuration file for the
frpserver. - Configure Client (frpc): Guides you through the process of creating a configuration file for the
frpclient. - Manage Services: Provides a submenu to manage the
systemdservices forfrpsandfrpc. - Set up automatic service reset: Creates a cron job to automatically restart all
frpservices. - Exit: Exits the script.
- The configuration files are stored in
/etc/frp/. - The script will back up any existing configuration files before creating new ones.
- The script can create
systemdservices forfrpsandfrpc. - You can manage the services (start, stop, restart, status, logs) from the "Manage Services" menu.