Estimated Reading Time: 2 minutes|Last Updated: 11/19/2021, 7:57:43 AM

# Installation

This document describe how to install edge-cli.

If you want to use edge-cli by docker, please goto docker document

# 1. Prepare

We will need to access the following public network addresses. If your network has a firewall, you need to add proper rules to white list them.

openresty.com 443 
openresty.org 443 
pkg.openresty.com 443 
api.openresty.com 443 

We need to prepare the following files.

  • openresty-edge-config-[% version-number %].rpm or openresty-edge-config-[% version-number %].deb

# 2. Installation

  • Please login openresty website

  • Go to OpenResty Download Center

  • Download the openresty-edge-config package

    If your system is debian, ubuntu, you should download openresty-edge-config-[% version-number %].deb.

    If your system is centos, fedora, rhel, you should download openresty-edge-config-[% version-number %].rpm

  • Copy openresty-edge-config to the current directory

  • Download the installation script:

    curl -O https://openresty.com/client/oredge/install-edge-cli.sh
    

    If you get a message like the following:

    curl: command not found
    

    It is possible that curl is not installed on the system or that the system shell program does not contain a search path for curl.

    You can use absolute paths to retry.

    /usr/bin/curl -O https://openresty.com/client/oredge/install-edge-cli.sh
    

    Your system's path may be different, contact your webmaster or use a command such as which bash to check the path to correct the situation.

  • Execute the installation script:

    Note, you should put install-edge-cli.sh and openresty-edge-config package in the same directory.

    sudo /bin/bash -x install-edge-cli.sh
    

# 3. Set path

please set PATH environment in ~/.bash_profile.

export PATH=/usr/local/oredge-admin/bin:$PATH

# 4. Config

If you don't know how to get api_token, please goto API Token document.

Add config to ~/.oredge/config.

mkdir ~/.oredge

cat << EOF > ~/.oredge/config
[admin]
host=admin-dev.openresty.com
port=443
verify_ssl=true
api_token=xxxxxxxxxxxxxxxxxxxxxx
EOF

# 5. Try cli

oredge --help