Basic Usage

Note: There is a potential memory leak problem with this server and remains unsolved, we recommend using Docker to mitigate this problem, refer to Docker. Related discussion:

Download or build the binary

Download the webp-server-go from release page.

Dump config file

./webp-server -dump-config > config.json

The default config.json may look like this.

    "HOST": "",
    "PORT": "3333",
    "QUALITY": "80",
    "IMG_PATH": "/path/to/pics",
    "EXHAUST_PATH": "/path/to/exhaust",
    "ALLOWED_TYPES": ["jpg","png","jpeg"]

Config Example

In the following example, the image path and website URL.

Image Path Website Path

The config.json should be like:


EXHAUST_PATH is cache folder for output webp images, with EXHAUST_PATH set to /var/cache/webp in the example above, your webp image will be saved at /var/cache/webp/pics/tsuki.jpg.1582558990.webp.

If you'd like to use a remote backend(such as external Nginx served static site, Aliyun OSS or Tencent COS), please refer to Remote Backend.


./webp-server --config=/path/to/config.json

To keep this program running, refer to Supervisor section.

Nginx Example

This is an example for a typical Wordpress installation.

location ^~ /wp-content/uploads/ {
    proxy_set_header Host $http_host;

If you use Caddy, you may refer to 优雅的让 Halo 支持 webp 图片输出.

If there is a CDN in front of your website, please refer to Use with CDN

results matching ""

    No results matching ""