Configuration options
PixivFE reads settings from environment variables and a YAML file. The first source that sets a value wins:
The config file path itself is found the same way:
Configuration file
Minimal config.yaml:
basic:
token:
- 123456_arstdhneideploy/config.yaml.example lists every option. Copy it to config.yaml and edit.
Use another path:
./pixivfe -config deploy/config.yaml
PIXIVFE_CONFIGFILE=deploy/config.yaml ./pixivfeEnvironment variables
Every option has an environment variable, which beats the file:
PIXIVFE_TOKEN=YOUR_TOKEN PIXIVFE_PORT=8282 ./pixivfedeploy/.env.example lists them all. Copy it to .env and edit.
Default user preferences
Instance operators can set initial preferences for visitors. Visitors can change these settings on the Settings page, and resetting preferences restores the instance defaults.
Visitor preferences are stored in their browser's cookies, not the instance's filesystem. They survive backend updates as long as the browser retains those cookies. Saved preferences expire after one year of inactivity and are renewed periodically while the visitor browses the instance. Clearing site cookies or switching to a different instance hostname restores the instance defaults.
Add a settingDefaults section to config.yaml:
settingDefaults:
SeasonalEffectsEnabled: true
FilterProfile: '{"v":1,"r15":"show","r18":"show","r18g":"show","ai":"censor","default_search_mode":"safe"}'Or set the equivalent environment variables (including in Docker Compose):
environment:
PIXIVFE_SEASONAL_EFFECTS_ENABLED: "true"
PIXIVFE_FILTER_PROFILE: '{"v":1,"r15":"show","r18":"show","r18g":"show","ai":"censor","default_search_mode":"safe"}'Environment variables take precedence over the configuration file.
| YAML setting | Environment variable |
|---|---|
ImageProxy | PIXIVFE_IMAGE_PROXY |
StaticProxy | PIXIVFE_STATIC_PROXY |
UgoiraProxy | PIXIVFE_UGOIRA_PROXY |
NovelFontType | PIXIVFE_NOVEL_FONT_TYPE |
NovelViewMode | PIXIVFE_NOVEL_VIEW_MODE |
ThumbnailToNewTab | PIXIVFE_THUMBNAIL_TO_NEW_TAB |
SeasonalEffectsEnabled | PIXIVFE_SEASONAL_EFFECTS_ENABLED |
Lang | PIXIVFE_LANG |
LogoStyle | PIXIVFE_LOGO_STYLE |
ThumbnailNavVisible | PIXIVFE_THUMBNAIL_NAV_VISIBLE |
OpenAllButton | PIXIVFE_DEFAULT_OPEN_ALL_BUTTON |
DesktopSidebarHidden | PIXIVFE_DESKTOP_SIDEBAR_HIDDEN |
BookmarkDefaultPrivate | PIXIVFE_BOOKMARK_DEFAULT_PRIVATE |
FilterProfile | PIXIVFE_FILTER_PROFILE |
Use FilterProfile to set defaults for content filters, search mode, and artist or tag blacklists. Its r15, r18, r18g, and ai values accept show, censor, or hide. The optional default_search_mode accepts all, safe, or r18. Keep v set to 1.
Visitors' browsers apply content filters and blacklists with JavaScript, so visitors with JavaScript disabled see unfiltered results. A visitor who saves their own filters keeps them; the instance defaults apply to everyone else.
PIXIVFE_OPEN_ALL_BUTTON makes the Open All feature available on the instance; PIXIVFE_DEFAULT_OPEN_ALL_BUTTON sets its initial preference for visitors.
For new configurations, use the settings listed above.
Basic options
These options must be nested under a basic: block in config.yaml.
PIXIVFE_CONFIGFILE
| YAML name | Environment variable | Required | Default | Options |
|---|---|---|---|---|
| - | PIXIVFE_CONFIGFILE | No | ./config.yaml | - |
Specifies path to a YAML configuration file. The -config command-line flag takes priority over this environment variable.
PIXIVFE_HOST
| YAML name | Environment variable | Required | Default | Options |
|---|---|---|---|---|
host | PIXIVFE_HOST | No | localhost | Hostname or IP address |
The hostname or IP address that PixivFE should listen on and accept incoming connections from.
Mutually exclusive with PIXIVFE_UNIXSOCKET.
NOTE
If you're not using a reverse proxy or running PixivFE inside Docker, you should set PIXIVFE_HOST=0.0.0.0. This will allow PixivFE to accept connections from any IP address or hostname. If you don't set this, PixivFE will refuse direct connections from other machines or devices on your network.
PIXIVFE_PORT
| YAML name | Environment variable | Required | Default | Options |
|---|---|---|---|---|
port | PIXIVFE_PORT | No | 8282 | Port number |
The port number that PixivFE should listen on and accept incoming connections from.
Mutually exclusive with PIXIVFE_UNIXSOCKET.
PIXIVFE_UNIXSOCKET
| YAML name | Environment variable | Required | Default | Options |
|---|---|---|---|---|
unixSocket | PIXIVFE_UNIXSOCKET | No | - | UNIX socket path |
The UNIX socket path that PixivFE should use.
Mutually exclusive with PIXIVFE_HOST/PIXIVFE_PORT.
PIXIVFE_UNIXSOCKET_PERMISSIONS
| YAML name | Environment variable | Required | Default | Options |
|---|---|---|---|---|
unixSocketPermissions | PIXIVFE_UNIXSOCKET_PERMISSIONS | No | 666 | File-system permissions in either Symbolic or Octal notation |
Specifies file permissions applied to the UNIX socket.
Environment variable format:
PIXIVFE_UNIXSOCKET_PERMISSIONS=rw-r-----
# or
PIXIVFE_UNIXSOCKET_PERMISSIONS=640Config file format:
basic:
unixSocketPermissions: "rw-r-----"
# or
basic:
unixSocketPermissions: "640"PIXIVFE_UNIXSOCKET_USER
| YAML name | Environment variable | Required | Default | Options |
|---|---|---|---|---|
unixSocketUser | PIXIVFE_UNIXSOCKET_USER | No | - | Username or UID |
Specifies user owner applied to the UNIX socket.
PIXIVFE_UNIXSOCKET_GROUP
| YAML name | Environment variable | Required | Default | Options |
|---|---|---|---|---|
unixSocketGroup | PIXIVFE_UNIXSOCKET_GROUP | No | - | Group name or GID |
Specifies group owner applied to the UNIX socket.
PIXIVFE_TOKEN
| YAML name | Environment variable | Required | Default | Options |
|---|---|---|---|---|
token | PIXIVFE_TOKEN | Yes | - | Comma-separated tokens (multiple allowed) |
PHPSESSID cookie(s) for authentication with the pixiv API.
Multiple tokens can be specified. For isolated development checks, use dummy-session to omit the upstream PHPSESSID cookie when that token is selected.
Environment variable format:
PIXIVFE_TOKEN=token1,token2,token3Config file format:
token:
- token1
- token2Content proxy servers
These options must be nested under a contentProxies: block in config.yaml.
pixiv requires Referer: https://www.pixiv.net/ in the HTTP request headers to fetch images from their servers.
If any of these individual settings is not set, the built-in proxy will be used for that specific service.
Custom proxy URLs must use HTTP or HTTPS and must not contain credentials or fragments. Percent-encode spaces and reserved characters in paths and query values. Invalid proxy preferences fall back to the instance's configured proxy. Third-party proxies receive visitors' media requests, including their IP addresses; choose a proxy you trust.
For setting up your own proxy server, refer to hosting an image proxy server. Alternatively, see the list of public image proxies if you prefer to use an existing deployment.
PIXIVFE_IMAGEPROXY
| YAML name | Environment variable | Required | Default | Options |
|---|---|---|---|---|
imageProxy | PIXIVFE_IMAGEPROXY | No | (built-in proxy) | URL |
The URL of a server that acts as a reverse proxy for i.pximg.net.
Browsers also fetch animation frames from this proxy as ZIP archives under /img-zip-ugoira/, so a proxy on another origin must pass through the Access-Control-Allow-Origin header that i.pximg.net sends. Without it, animations fall back to the ugoira proxy.
PIXIVFE_STATICPROXY
| YAML name | Environment variable | Required | Default | Options |
|---|---|---|---|---|
staticProxy | PIXIVFE_STATICPROXY | No | (built-in proxy) | URL |
The URL of a server that acts as a reverse proxy for s.pximg.net.
PIXIVFE_UGOIRAPROXY
| YAML name | Environment variable | Required | Default | Options |
|---|---|---|---|---|
ugoiraProxy | PIXIVFE_UGOIRAPROXY | No | (built-in proxy) | URL |
The base URL of an animation proxy or a conversion service such as media-api. The built-in proxy serves animations from t-hk.ugoira.com.
Browsers play animations and convert them to MP4, WebM, GIF or WebP themselves, using frames from the image proxy. This proxy is only a fallback: it plays animations when JavaScript is off or the browser can't play them, and when pixiv doesn't return frame data.
To enable illustration downloads and server-side animation conversion (including AVIF), point this setting at the media-api base URL. PixivFE uses /illust/{id} for illustration ZIP downloads, /ugoira/{id} for animation playback and conversion, and /pximg/... for proxied image downloads. With the built-in proxy, the Download menu appears only for animations with frame data and requires JavaScript.
Token management
These options must be nested under a tokenManager: block in config.yaml.
PixivFE implements exponential backoff for token management to manage rate limiting.
The following environment variables control how PixivFE manages token timeouts when a token encounters repeated failures. The backoff time for a token starts at the base timeout and doubles with each failure, up to the maximum backoff time.
Authentication failures (401 or 403) and rate limits (429) put a token into cooldown. Missing resources, network failures, and upstream server errors do not disable tokens. Tokens rejoin the pool when their cooldown expires; a successful response resets their failure count. If every token is cooling down, wait for a token to recover before retrying.
Private profile views and login-only works require visitors to sign in with their personal pixiv session. Configured instance tokens do not authorize private bookmarks, private follows, followers, or login-only artwork and novels.
PIXIVFE_TOKEN_LOAD_BALANCING
| YAML name | Environment variable | Required | Default | Options |
|---|---|---|---|---|
tokenLoadBalancing | PIXIVFE_TOKEN_LOAD_BALANCING | No | round-robin | round-robin, random, least-recently-used |
Specifies the method for selecting tokens when multiple tokens are provided in PIXIVFE_TOKEN.
round-robin: Tokens are used in a circular order.random: A random token is selected for each request.least-recently-used: The token that hasn't been used for the longest time is selected.
This option is useful when you have multiple pixiv accounts and want to distribute the load across them.
PIXIVFE_TOKEN_BASE_TIMEOUT
| YAML name | Environment variable | Required | Default | Options |
|---|---|---|---|---|
tokenBaseTimeout | PIXIVFE_TOKEN_BASE_TIMEOUT | No | 1000ms | time.Duration |
Initial backoff duration on token failure.
PIXIVFE_TOKEN_MAX_BACKOFF_TIME
| YAML name | Environment variable | Required | Default | Options |
|---|---|---|---|---|
tokenMaxBackoffTime | PIXIVFE_TOKEN_MAX_BACKOFF_TIME | No | 32000ms | time.Duration |
Maximum backoff duration during exponential retry.
HTTP caching
These options must be nested under a httpCache: block in config.yaml.
These settings control HTTP caching for responses sent to browsers.
PIXIVFE_CACHE_CONTROL_MAX_AGE
| YAML name | Environment variable | Required | Default | Options |
|---|---|---|---|---|
maxAge | PIXIVFE_CACHE_CONTROL_MAX_AGE | No | 30s | time.Duration |
Controls the max-age directive in the Cache-Control response header for artwork pages.
This determines how long browsers should cache the page before revalidating with the server.
PIXIVFE_CACHE_CONTROL_STALE_WHILE_REVALIDATE
| YAML name | Environment variable | Required | Default | Options |
|---|---|---|---|---|
staleWhileRevalidate | PIXIVFE_CACHE_CONTROL_STALE_WHILE_REVALIDATE | No | 60s | time.Duration |
Controls the stale-while-revalidate directive in the Cache-Control response header for artwork pages.
This allows browsers to show stale content while fetching a fresh version in the background.
Request parameters
These options must be nested under a request: block in config.yaml.
PIXIVFE_ACCEPTLANGUAGE
| YAML name | Environment variable | Required | Default | Options |
|---|---|---|---|---|
acceptLanguage | PIXIVFE_ACCEPTLANGUAGE | No | en-US,en;q=0.5 | Accept-Language value |
The value of the Accept-Language header used for requests to pixiv's API.
Change this to modify the response language.
Features
These options must be nested under a feature: block in config.yaml.
PIXIVFE_POPULAR_SEARCH
| YAML name | Environment variable | Required | Default | Options |
|---|---|---|---|---|
popularSearch | PIXIVFE_POPULAR_SEARCH | No | false | Boolean |
Controls whether searching by popularity for a given tag is enabled.
WARNING
This feature requires several API calls for each search.
PIXIVFE_FAST_TAG_SUGGESTIONS
| YAML name | Environment variable | Required | Default | Options |
|---|---|---|---|---|
fastTagSuggestions | PIXIVFE_FAST_TAG_SUGGESTIONS | No | false | Boolean |
Controls whether to use a fast tag suggestion endpoint with lower latency.
When enabled, tag completion requests will use a Vercel-cached proxy endpoint (https://tag-suggestions.vercel.app/api/proxy) instead of the default pixiv endpoint (https://www.pixiv.net/rpc/cps.php).
This can improve response times for tag suggestions through Vercel's edge caching.
PIXIVFE_OPEN_ALL_BUTTON
| YAML name | Environment variable | Required | Default | Options |
|---|---|---|---|---|
openAllButton | PIXIVFE_OPEN_ALL_BUTTON | No | false | Boolean |
Controls whether the "Open All" button feature is available in user settings.
When enabled, users can configure an "Open All" button that appears in some places to open multiple artworks at once in new tabs.
WARNING
This feature can open many browser tabs simultaneously, which may impact browser performance or be blocked by popup blockers.
PIXIVFE_ATOM_FEEDS
| YAML name | Environment variable | Required | Default | Options |
|---|---|---|---|---|
atomFeeds | PIXIVFE_ATOM_FEEDS | No | true | Boolean |
Controls whether the instance serves user Atom feeds. Set this to false to hide feed links on user pages and return HTTP 404 for /users/{id}/atom.xml.
Instance information
These options must be nested under an instance: block in config.yaml.
PIXIVFE_REPO_URL
| YAML name | Environment variable | Required | Default | Options |
|---|---|---|---|---|
repoUrl | PIXIVFE_REPO_URL | No | https://gitlab.com/pixivfe/PixivFE | URL |
The URL of the PixivFE source code repository.
This is used to provide links to the application source code and specific commit information.
Change this if you're running a fork of PixivFE to link to your own repository instead.
Network proxy
Used to set the proxy server that PixivFE will use for all requests.
Not to be confused with the image proxy, which is used to comply with the Referer check required by i.pximg.net.
Requests use the proxy specified in the configuration option that matches the scheme of the request (HTTP_PROXY or HTTPS_PROXY).
This selection is based on the scheme of the request being made, not on the protocol used by the proxy server itself.
NOTE
These options are currently only available through environment variables.
HTTPS_PROXY
| YAML name | Environment variable | Required | Default | Options |
|---|---|---|---|---|
| - | HTTPS_PROXY | No | - | Proxy URL |
Proxy server used for requests made over HTTPS.
HTTP_PROXY
| YAML name | Environment variable | Required | Default | Options |
|---|---|---|---|---|
| - | HTTP_PROXY | No | - | Proxy URL |
Proxy server used for requests made over plain HTTP.
Internationalization
These options must be nested under an internationalization: block in config.yaml.
PIXIVFE_STRICT_MISSING_KEYS
| YAML name | Environment variable | Required | Default | Options |
|---|---|---|---|---|
strictMissingKeys | PIXIVFE_STRICT_MISSING_KEYS | No | false | Boolean |
Controls strict mode for missing translation keys.
When enabled, missing keys are logged and visibly wrapped using markers, which is useful for development and translation efforts.
Logging
These options must be nested under a log: block in config.yaml.
Options to configure zerolog, which PixivFE uses for structured logging.
PIXIVFE_LOG_LEVEL
| YAML name | Environment variable | Required | Default | Options |
|---|---|---|---|---|
logLevel | PIXIVFE_LOG_LEVEL | No | info | debug, info, warn, error |
Sets the minimum level of log messages to output.
debug: Includes all log messages, including routine HTTP request and upstream spans.info: Includes startup and lifecycle messages, token recovery notices, warnings, and errors (including5xxresponses, upstream failures, and token cooldowns).warn: Includes warnings (such as token cooldowns and transient upstream failures) and errors.error: Includes only internal server errors, token-pool exhaustion, and fatal startup failures.
NOTE
This setting is ignored when development mode (PIXIVFE_DEV) is enabled, as development mode forces the log level to debug.
PIXIVFE_LOG_OUTPUTS
| YAML name | Environment variable | Required | Default | Options |
|---|---|---|---|---|
logOutputs | PIXIVFE_LOG_OUTPUTS | No | /dev/stderr | Array/comma-separated list of file paths |
Specifies where log messages should be sent. This can be a single output or multiple. Special values /dev/stdout and /dev/stderr are supported.
Environment variable format:
PIXIVFE_LOG_OUTPUTS=/dev/stderr,/var/log/pixivfe.logConfig file format:
log:
logOutputs:
- /dev/stderr
- /var/log/pixivfe.logPIXIVFE_LOG_FORMAT
| YAML name | Environment variable | Required | Default | Options |
|---|---|---|---|---|
logFormat | PIXIVFE_LOG_FORMAT | No | console | console, json |
Determines the format of log messages.
consoleuses human-readable timestamps and compact HTTP request lines. Colors are enabled for each terminal output unlessNO_COLORis set to a non-empty value.jsonwrites one structured JSON object per line, including configuration loading messages and the redacted startup configuration.
If PixivFE cannot open any configured log output, it logs the failures and continues writing to stderr in the selected format.
Development
These options must be nested under a development: block in config.yaml.
PIXIVFE_DEV
| YAML name | Environment variable | Required | Default | Options |
|---|---|---|---|---|
inDevelopment | PIXIVFE_DEV | No | false | Boolean |
Set to true to enable development mode.
This sets the default log level to debug and disables logging for static asset and image proxy paths to reduce noise during development.
PIXIVFE_SAVE_RESPONSES
| YAML name | Environment variable | Required | Default | Options |
|---|---|---|---|---|
saveResponses | PIXIVFE_SAVE_RESPONSES | No | false | Boolean |
Controls whether API responses from pixiv are saved to disk.
When enabled, responses will be saved to the directory specified by PIXIVFE_RESPONSE_SAVE_LOCATION.
PIXIVFE_RESPONSE_SAVE_LOCATION
| YAML name | Environment variable | Required | Default | Options |
|---|---|---|---|---|
responseSaveLocation | PIXIVFE_RESPONSE_SAVE_LOCATION | No | /tmp/pixivfe/responses | File path |
Defines where responses from the pixiv API are saved when PIXIVFE_SAVE_RESPONSES is enabled.