PixivFE can be installed using various methods. This guide covers installation using Docker (recommended for production) and using a binary with a Caddy reverse proxy.
!!! note
PixivFE requires a Pixiv account token to access the API. Refer to the [Obtaining the `PIXIVFE_TOKEN` cookie](obtaining-pixivfe-token.md) guide for detailed instructions.
Docker lets you run containerized applications. Containers are loosely isolated environments that are lightweight and contain everything needed to run the application, so there's no need to rely on what's installed on the host.
Docker images for PixivFE are available at Docker Hub, with support for the amd64 platform.
!!! warning
Deploying PixivFE using Docker Compose requires the Compose plugin to be installed. Follow these [instructions on the Docker Docs](https://docs.docker.com/compose/install) on how to install it.
Clone the PixivFE repository and navigate to the directory:
git clone https://codeberg.org/VnPower/PixivFE.git && cd PixivFE
Copy the PHPSESSID
cookie value into docker/pixivfe_token.txt
. This file will be used as a Docker secret.
Copy .env.example
to .env
and configure the variables as needed. Refer to the Environment variables page for more information.
!!! note
Ensure you set `PIXIVFE_HOST=0.0.0.0` in the `.env` file.
This allows PixivFE to bind to all network interfaces inside the container, which is necessary for Docker's network management to function correctly. The network access restrictions will be handled by Docker itself, not within PixivFE.
Run docker compose up -d
to start PixivFE.
To view the container logs, run docker logs -f pixivfe
.
Clone the PixivFE repository and navigate to the directory:
git clone https://codeberg.org/VnPower/PixivFE.git && cd PixivFE
Copy .env.example
to .env
and configure the variables as needed. Refer to the Environment variables page for more information.
!!! note
Ensure you set `PIXIVFE_HOST=0.0.0.0` in the `.env` file.
This allows PixivFE to bind to all network interfaces inside the container, which is necessary for Docker's network management to function correctly. The network access restrictions will be handled by Docker itself, not within PixivFE.
Run the following command to deploy PixivFE:
=== "Default port (8282
)"
```bash
docker run -d --name pixivfe -p 8282:8282 --env-file .env vnpower/pixivfe:latest
```
=== "Custom port (e.g., 8080
)"
```bash
docker run -d --name pixivfe -p 8080:8282 --env-file .env vnpower/pixivfe:latest
```
If you're planning to use a reverse proxy, modify the port binding to only listen on the localhost port (e.g., 127.0.0.1:8282:8282
). This ensures that PixivFE listens only on the localhost, making it accessible solely through the reverse proxy.
This setup uses Caddy as the reverse proxy. Caddy is a great alternative to NGINX because it is written in the Go programming language, making it more lightweight and efficient. Additionally, Caddy is easy to configure, providing a simple and straightforward way to set up a reverse proxy.
Clone the PixivFE repository, navigate to the directory, and install the dependencies:
git clone https://codeberg.org/VnPower/PixivFE.git && cd PixivFE
go install
Copy .env.example
to .env
and configure the variables as needed. Refer to the Environment variables page for more information.
Run env $(cat .env | xargs) go run main.go
to start PixivFE. It will be accessible at localhost:8282
.
Install Caddy using your package manager.
In the PixivFE directory, create a file named Caddyfile
with the following content:
example.com {
reverse_proxy localhost:8282
}
Replace example.com
with your domain and 8282
with the PixivFE port if you changed it.
Run caddy run
to start Caddy.
To update PixivFE to the latest version, follow the steps below that are relevant to your deployment method.
Pull the latest Docker image and repository changes:
docker compose pull && git pull
Restart the container:
docker compose up -d
Pull the latest Docker image and repository changes:
docker pull vnpower/pixivfe:latest && git pull
Stop and remove the existing container:
docker stop pixivfe && docker rm pixivfe
Restart the container:
docker run -d --name pixivfe -p 8282:8282 --env-file .env vnpower/pixivfe:latest
Pull the latest changes from the repository:
git pull
Rebuild and start PixivFE:
go install
env $(cat .env | xargs) go run main.go