### Manual Linux Installation and Systemd Configuration Source: https://github.com/natfrp/wiki/blob/master/launcher/usage.md Steps for manually installing the launcher on Linux and configuring it as a user-level systemd service for automatic startup. ```bash mkdir -p ~/.config/natfrp/ cd ~/.config/natfrp/ tar -I zstd -xvf natfrp-service_*.tar.zst rm natfrp-service_*.tar.zst chmod +x frpc natfrp-service ./natfrp-service webui --init ``` ```systemd [Unit] Description=SakuraFrp Launcher After=network.target [Service] Type=simple TimeoutStopSec=20 Restart=always RestartSec=5s ExecStart=%h/.config/natfrp/natfrp-service --daemon [Install] WantedBy=default.target ``` ```bash systemctl --user enable --now natfrp.service systemctl --user status natfrp.service ``` -------------------------------- ### Install and Configure SakuraFrp Launcher Source: https://context7.com/natfrp/wiki/llms.txt Instructions for installing the natfrp-service launcher via shell scripts or Docker. Includes commands for service management, remote access setup, and manual initialization. ```bash # Linux 一键安装脚本 sudo bash -c ". <(curl -sSL https://doc.natfrp.com/launcher.sh)" # Docker 容器部署 docker run -d --network=host --restart=always --name=natfrp-service natfrp.com/launcher # 手动初始化 ./natfrp-service webui --init ./natfrp-service remote-kdf your_password ``` -------------------------------- ### Install SakuraFrp Launcher on Linux using Script Source: https://github.com/natfrp/wiki/blob/master/launcher/usage.md This snippet shows how to install the SakuraFrp Launcher on Linux systems using a one-click installation script. It supports direct installation and bypassing Docker detection. The script is sourced from a GitHub pull request. ```bash sudo bash -c ". <(curl -sSL https://doc.natfrp.com/launcher.sh)" # 或者使用 wget, 脚本会自动通过包管理器安装 curl sudo bash -c ". <(wget -O- https://doc.natfrp.com/launcher.sh)" # 如果需要绕过 Docker 检测强制安装到系统中 sudo bash -c ". <(curl -sSL https://doc.natfrp.com/launcher.sh) direct" ``` -------------------------------- ### Custom Installation Path for SakuraFrp Launcher (Windows) Source: https://github.com/natfrp/wiki/blob/master/faq/launcher.md This command demonstrates how to specify a custom installation directory for the SakuraFrp Launcher executable on Windows using Inno Setup command-line parameters. The '/DIR' argument followed by the desired path allows for flexible installation locations. Ensure the path ends with 'SakuraFrpLauncher' to create a dedicated folder. ```batch SakuraLauncher.exe /DIR="D:\MyFolder\SakuraFrpLauncher" ``` -------------------------------- ### Deploy SakuraFrp Launcher via Docker Source: https://github.com/natfrp/wiki/blob/master/launcher/usage.md Commands to initialize and run the SakuraFrp launcher container. Includes options for persistent storage and remote management authentication. ```bash mkdir -p /etc/natfrp docker run \ -d \ --network=host \ --restart=always \ --pull=always \ --name=natfrp-service \ -v /etc/natfrp:/run \ natfrp.com/launcher ``` ```bash docker run \ -d \ --network=host \ --restart=always \ --pull=always \ --name=natfrp-service \ -e "NATFRP_TOKEN=<访问密钥>" \ -e "NATFRP_REMOTE=<设定一个远程管理密码,最少8个字符>" \ -e "TZ=Asia/Shanghai" \ natfrp.com/launcher ``` -------------------------------- ### Download and Install frpc on Linux Source: https://github.com/natfrp/wiki/blob/master/frpc/_usage/linux.md This section demonstrates how to download the frpc binary to the /usr/local/bin directory using either wget or curl. It also includes commands to set execute permissions and verify the installation using ls and md5sum. The frpc binary is typically UPX compressed, with an option to download an uncompressed version. ```bash cd /usr/local/bin # 一般来说只需要使用这条命令: wget -O frpc <下载地址> # 如果上面的命令报错,请尝试这条: curl -Lo frpc <下载地址> # Linux frpc 通常已经过 UPX 压缩,如需下载未压缩的版本请在下载地址尾部加上 _noupx chmod 755 frpc ls -ls frpc md5sum frpc ``` -------------------------------- ### Retrieve Docker Container Logs Source: https://github.com/natfrp/wiki/blob/master/launcher/usage.md Command to view the initial WebUI credentials generated by the Docker container. ```bash docker logs natfrp-service ``` -------------------------------- ### Detect Linux Initialization System Source: https://github.com/natfrp/wiki/blob/master/frpc/_usage/linux.md This command helps identify the initialization system used by your Linux distribution. Knowing the init system (e.g., systemd, Upstart, SysVinit) is essential for configuring frpc to start automatically on boot. ```bash if [[ `/sbin/init --version` =~ upstart ]]; then echo Upstart; elif [[ `systemctl` =~ -.mount ]]; then echo systemd; elif [[ -f /etc/init.d/cron && ! -h /etc/init.d/cron ]]; then echo SysVinit; else echo Unknown; fi ``` -------------------------------- ### Start Tunnels via frpc Command Line Source: https://context7.com/natfrp/wiki/llms.txt Demonstrates how to initiate tunnels using the frpc CLI. Supports single or multiple tunnel IDs, environment variables, and advanced network flags like DNS settings and proxy configuration. ```bash # 启动单个隧道 frpc -f wdnmdtoken666666:114514 # 启动多个隧道(用逗号分隔隧道 ID) frpc -f wdnmdtoken666666:114514,114515,114516 # 使用环境变量代替命令行参数 export NATFRP_TOKEN=wdnmdtoken666666 export NATFRP_TARGET=114514,114515 frpc # 启动时写入配置文件(下次可直接运行) frpc -f wdnmdtoken666666:114514 -w # 强制使用系统 DNS frpc -f wdnmdtoken666666:114514 --system_dns # 强制使用加密 DNS frpc -f wdnmdtoken666666:114514 --encrypt_dns # 指定代理连接节点 frpc -f wdnmdtoken666666:114514 --proxy socks5://127.0.0.1:1080 # 查看完整版本号 frpc -V ``` -------------------------------- ### 配置 Forge/NeoForge JVM 参数 Source: https://github.com/natfrp/wiki/blob/master/offtopic/mc-java-server.md 对于 Forge 和 NeoForge 核心,通过修改 user_jvm_args.txt 文件来配置内存参数,无需在启动命令中包含 -jar 选项。 ```text # Xmx and Xms set the maximum and minimum RAM usage, respectively. -Xmx4G -Xms4G ``` -------------------------------- ### Uninstall SakuraFrp Launcher on Linux using Script Source: https://github.com/natfrp/wiki/blob/master/launcher/usage.md This snippet demonstrates how to uninstall the SakuraFrp Launcher on Linux systems using the same installation script with the 'uninstall' argument. This is a convenient way to remove the launcher if it was installed via the script. ```bash sudo bash -c ". <(curl -sSL https://doc.natfrp.com/launcher.sh) uninstall" ``` -------------------------------- ### 编写 Windows 批处理启动脚本 Source: https://github.com/natfrp/wiki/blob/master/offtopic/mc-java-server.md 为不同类型的 Minecraft 服务器核心创建 .bat 启动脚本。通过 java 命令调用 jar 文件并应用内存参数。 ```batch java -Xmx4G -Xms4G -jar server.jar @pause ``` ```batch java -Xmx4G -Xms4G -jar fabric-server-launch.jar @pause ``` ```batch java -Xmx4G -Xms4G -jar paper-1.21-119.jar @pause ``` -------------------------------- ### Check frpc Version on Linux Source: https://github.com/natfrp/wiki/blob/master/frpc/_usage/linux.md After installing frpc, this command can be used to verify the installation and check the currently installed version of the frpc client. This is a simple way to confirm that the binary is accessible and functional. ```bash frpc -v ``` -------------------------------- ### Configure RustDesk with SakuraFrp (Manual) Source: https://github.com/natfrp/wiki/blob/master/rd/index.md Manual configuration details for RustDesk clients connecting to SakuraFrp's service. This includes the ID Server, API Server, and Key. ```text ID 服务器: rd-1.natfrp.cloud API 服务器: https://api.natfrp.com/rd Key: uUnb9eVVNZskn4xjkflCTKbO1CVCax4dg+nw9C26gkQ= ``` -------------------------------- ### 配置 Java 启动变量 Source: https://github.com/natfrp/wiki/blob/master/offtopic/mc-java-server.md 设置 Java 虚拟机的内存分配参数。Xmx 指定最大内存,Xms 指定初始内存,建议两者设为相同以优化性能。 ```text -Xmx4G -Xms4G -jar ``` -------------------------------- ### Regenerate Machine GUID on Windows Source: https://github.com/natfrp/wiki/blob/master/rd/index.md Steps to regenerate the Machine GUID on Windows to resolve device ID conflicts. This involves editing the Windows Registry. ```batch regedit # Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography # Backup the MachineGuid value # Delete the MachineGuid entry # Restart the computer ```