While there are no official Varnish packages for Amazon Linux, you could try installing an EL9 package manually.
There's no guarantee on 100% compatibility, but I did manage to install it and run varnishd
.
FYI: https://packagecloud.io/varnishcache is the place to find official Varnish packages.
Copy the URL of the download link and wget
the RPM file on your server. Then you can install it using sudo dnf install
.
Example using Varnish Cache 7.3
Here's an example using Varnish Cache 7.3:
sudo wget -O varnish.rpm https://packagecloud.io/varnishcache/varnish73/packages/el/9/varnish-7.3.0-1.el9.x86_64.rpm/download.rpm?distro_version_id=240
sudo dnf install varnish.rpm
Use Red Hat, Ubuntu or Debian instead
If you do want to make sure you can use official packages with 100% compatibility, you should consider switching to Red Hat, Ubuntu or Debian images on AWS.
See https://www.varnish-software.com/developers/tutorials/#installations for install guides.
Official Varnish AWS images
You could also use one of the official Varnish Software AWS images. Go to https://www.varnish-software.com/developers/tutorials/#cloud for install instructions for Debian or Red Hat.
FYI: the official AWS images will install Varnish Enterprise, the commercial version of Varnish. There will be an additional monthly license fee that is charged on top of the infrastructure cost. See https://docs.varnish-software.com/varnish-enterprise/ for more information about Varnish Enterprise features.