Skip to content

flywp/server-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 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 | 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

From anywhere inside a site folder, you can run the following commands that will be executed on a per-site basis.

fly start                   # starts the website (via Docker Compose)
fly stop                    # stops the website (via Docker Compose)
fly restart                 # restarts the website (via Docker Compose)
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. The CLI will find the appropriate WordPress folder to execute the wp command.

fly wp

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.