How to install Open Swoole on Ubuntu and Windows WSL

Published:

Open Swoole prebuilt packages for Ubuntu are available at Open Swoole Ubuntu PPA.

Open Swoole Ubuntu PPAOpen Swoole Ubuntu PPA

You can easily install the prebuilt Open Swoole packages from Open Swoole Ubuntu PPA if you are a user of Ubuntu or Ubuntu at Windows WSL.

How to install Open Swoole on Ubuntu

Install Open Swoole on Ubuntu 20.04 LTS (Focal Fossa)

apt update
apt install -y software-properties-common && add-apt-repository ppa:ondrej/php -y
apt install -y software-properties-common && add-apt-repository ppa:openswoole/ppa -y
# choose one PHP version:
#apt install -y php7.4-openswoole
#apt install -y php8.0-openswoole
apt install -y php8.1-openswoole
php --ri openswoole

Install Open Swoole on Ubuntu 22.04 LTS (Jammy Jellyfish)

apt update
apt install -y software-properties-common && add-apt-repository ppa:openswoole/ppa -y
# choose one PHP version:
#apt install -y php7.4-openswoole
#apt install -y php8.0-openswoole
apt install -y php8.1-openswoole
php --ri openswoole

How to install Open Swoole on Windows WSL

Windows WSL has installed Ubuntu 20.04 LTS (Focal Fossa) as the default Linux distribution. You can install Open Swoole by following the guide of installing on Ubuntu.

Install in other ways

You can find more details about How to install Open Swoole with Docker, PECL, Ubuntu PPA, Remi's CentOS repo and Windows at /docs/get-started/installation.