Installing Swoole via Debian/Ubuntu PPA by Ondřej Surý

By Luke Embrey @ Swoole Labs

Swoole can now be installed via the Ondřej Surý Debian/Ubuntu PPA, the ondrej/php PPA can be added to your package sources by running the following commands on Ubuntu/Debian:


# Install the Deb.Sury PHP Ubuntu PPA source
$ sudo apt install software-properties-common
$ sudo add-apt-repository ppa:ondrej/php
$ sudo apt-get update

Then after you have PHP installed, you can install a compatible version of Swoole which is prebuilt:


# Install Swoole for PHP 8.0
$ sudo apt install php8.0-swoole

# Check that Swoole is loaded
$ php -m | grep swoole

The Ondřej Surý Debian/Ubuntu PPA will only support the latest supported versions of PHP, so make sure you have a compatible PHP version installed.

This is a great way to quickly get started with Swoole PHP, everything gets configured for you, so it is easy for beginners to start with Swoole. There is specific ondrej/php documentation for this as well.

For more information and documentation on installing Swoole checkout the getting started guide and the installation guides.

Additionally, Swoole can be installed multiple ways, check the full documentation to see how to install via:

  • PHP PECL binary release
  • Building from source via GitHub