Installation #
Go install #
go install github.com/fasthttpd/fasthttpd/cmd/fasthttpd@latest
Download binary #
Download binary from release.
VERSION=0.5.1 GOOS=linux GOARCH=amd64; \
curl -fsSL "https://github.com/fasthttpd/fasthttpd/releases/download/v${VERSION}/fasthttpd_${VERSION}_${GOOS}_${GOARCH}.tar.gz" | \
tar xz fasthttpd && \
sudo mv fasthttpd /usr/sbin
- GOOS supports
linux
darwin
windows
- GOARCH supports
amd64
arm64
386
Homebrew #
brew tap fasthttpd/fasthttpd
brew install fasthttpd
Using yum or apt #
Download deb or rpm from release, and then execute apt install
or yum install
.
VERSION=0.5.1 ARCH=amd64; \
curl -fsSL -O "https://github.com/fasthttpd/fasthttpd/releases/download/v${VERSION}/fasthttpd_${VERSION}_${ARCH}.deb"
sudo apt install "./fasthttpd_${VERSION}_${ARCH}.deb"
Docker #
- Default configuration path is
/etc/fasthttpd/config.yaml
. - Default log directory is
/var/log/fasthttpd
. - FastHttpd is automatically started by systemd.
See https://hub.docker.com/r/fasthttpd/fasthttpd
Exposing external port #
docker run --rm -p 8080:80 fasthttpd/fasthttpd
Serve static content #
docker run --rm -p 8080:80 -v $(pwd)/public:/usr/share/fasthttpd/html fasthttpd/fasthttpd
Specify config.yaml #
docker run --rm -p 8080:80 -v your.config.yaml:/etc/fasthttpd/config.yaml fasthttpd/fasthttpd