Skip to content

flywp/server-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

server-cli

Easy CLI tool for servers managed by FlyWP.

Installation

Prerequisites

Quick Install

You can easily install the fly CLI tool using the following command. This will download and run the install.sh script, which will automatically detect your operating system and architecture, download the latest release, and install it to /usr/local/bin:

curl -sL https://raw.githubusercontent.com/flywp/server-cli/main/install.sh | sudo bash
Manual Installation

Manual Installation

If you prefer to manually download and install the binary, follow these steps:

  1. Download the precompiled binaries from the Releases page. Choose the version suitable for your operating system and architecture.

  2. Download the latest tarball for your platform:

    wget https://github.com/flywp/server-cli/releases/download/v0.1.0/fly-linux-amd64.tar.gz
  3. Extract the tarball:

    tar -xzf fly-linux-amd64.tar.gz
  4. Move the binary to a directory in your PATH:

    sudo mv fly-linux-amd64 /usr/local/bin/fly
  5. Verify the installation:

    fly version

Usage

Base Docker Compose

FlyWP has a base Docker Compose configuration for running MySQL, Redis, Ofelia, and Nginx Proxy that are shared for all sites hosted on the server. The base Docker Compose must be started before a site can be created.

fly base start              # starts the base services (mysql, redis, nginx-proxy)
fly base stop               # stops the base services   
fly base restart            # restarts the base services

Site Operations

You can run the following commands from anywhere inside a site folder or by specifying the domain name.

fly start --domain example.com       # starts the website
fly stop --domain example.com        # stops the website
fly restart --domain example.com     # restarts the website
fly wp --domain example.com          # execute WP-CLI commands
fly logs --domain example.com        # view logs from all containers or a single one
fly restart <container> --domain example.com  # restart a container
fly exec <container> --domain example.com     # execute commands inside a container. Default: "php"

Or run the commands from within the site directory without specifying the domain:

fly start                   # starts the website
fly stop                    # stops the website
fly restart                 # restarts the website
fly wp                      # execute WP-CLI commands
fly logs <container>        # view logs from all containers or a single one
fly restart <container>     # restart a container
fly exec <container>        # execute commands inside a container. Default: "php"

WP-CLI

wp-cli: To access wp-cli, use the following command from anywhere in the website folder or specify the domain name. The CLI will find the appropriate WordPress folder to execute the wp command.

fly wp --domain example.com

Global Commands

A few helper commands to debug the server installation and start/stop all sites.

fly status                  # shows the status of the system
fly sites start             # starts all sites
fly sites stop              # stops all sites
fly sites restart           # stops and starts all sites

License

This project is licensed under the MIT License. See the LICENSE file for details.