Skip to content

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:

yaml
basic:
  token:
    - 123456_arstdhnei

deploy/config.yaml.example lists every option. Copy it to config.yaml and edit.

Use another path:

sh
./pixivfe -config deploy/config.yaml
PIXIVFE_CONFIGFILE=deploy/config.yaml ./pixivfe

Environment variables ​

Every option has an environment variable, which beats the file:

sh
PIXIVFE_TOKEN=YOUR_TOKEN PIXIVFE_PORT=8282 ./pixivfe

deploy/.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:

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):

yaml
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 settingEnvironment variable
ImageProxyPIXIVFE_IMAGE_PROXY
StaticProxyPIXIVFE_STATIC_PROXY
UgoiraProxyPIXIVFE_UGOIRA_PROXY
NovelFontTypePIXIVFE_NOVEL_FONT_TYPE
NovelViewModePIXIVFE_NOVEL_VIEW_MODE
ThumbnailToNewTabPIXIVFE_THUMBNAIL_TO_NEW_TAB
SeasonalEffectsEnabledPIXIVFE_SEASONAL_EFFECTS_ENABLED
LangPIXIVFE_LANG
LogoStylePIXIVFE_LOGO_STYLE
ThumbnailNavVisiblePIXIVFE_THUMBNAIL_NAV_VISIBLE
OpenAllButtonPIXIVFE_DEFAULT_OPEN_ALL_BUTTON
DesktopSidebarHiddenPIXIVFE_DESKTOP_SIDEBAR_HIDDEN
BookmarkDefaultPrivatePIXIVFE_BOOKMARK_DEFAULT_PRIVATE
FilterProfilePIXIVFE_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 nameEnvironment variableRequiredDefaultOptions
-PIXIVFE_CONFIGFILENo./config.yaml-

Specifies path to a YAML configuration file. The -config command-line flag takes priority over this environment variable.

PIXIVFE_HOST ​

YAML nameEnvironment variableRequiredDefaultOptions
hostPIXIVFE_HOSTNolocalhostHostname 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 nameEnvironment variableRequiredDefaultOptions
portPIXIVFE_PORTNo8282Port number

The port number that PixivFE should listen on and accept incoming connections from.

Mutually exclusive with PIXIVFE_UNIXSOCKET.

PIXIVFE_UNIXSOCKET ​

YAML nameEnvironment variableRequiredDefaultOptions
unixSocketPIXIVFE_UNIXSOCKETNo-UNIX socket path

The UNIX socket path that PixivFE should use.

Mutually exclusive with PIXIVFE_HOST/PIXIVFE_PORT.

PIXIVFE_UNIXSOCKET_PERMISSIONS ​

YAML nameEnvironment variableRequiredDefaultOptions
unixSocketPermissionsPIXIVFE_UNIXSOCKET_PERMISSIONSNo666File-system permissions in either Symbolic or Octal notation

Specifies file permissions applied to the UNIX socket.

Environment variable format:

sh
PIXIVFE_UNIXSOCKET_PERMISSIONS=rw-r-----
# or
PIXIVFE_UNIXSOCKET_PERMISSIONS=640

Config file format:

yaml
basic:
  unixSocketPermissions: "rw-r-----"
# or
basic:
  unixSocketPermissions: "640"

PIXIVFE_UNIXSOCKET_USER ​

YAML nameEnvironment variableRequiredDefaultOptions
unixSocketUserPIXIVFE_UNIXSOCKET_USERNo-Username or UID

Specifies user owner applied to the UNIX socket.

PIXIVFE_UNIXSOCKET_GROUP ​

YAML nameEnvironment variableRequiredDefaultOptions
unixSocketGroupPIXIVFE_UNIXSOCKET_GROUPNo-Group name or GID

Specifies group owner applied to the UNIX socket.

PIXIVFE_TOKEN ​

YAML nameEnvironment variableRequiredDefaultOptions
tokenPIXIVFE_TOKENYes-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:

sh
PIXIVFE_TOKEN=token1,token2,token3

Config file format:

yaml
token:
  - token1
  - token2

Content 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 nameEnvironment variableRequiredDefaultOptions
imageProxyPIXIVFE_IMAGEPROXYNo(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 nameEnvironment variableRequiredDefaultOptions
staticProxyPIXIVFE_STATICPROXYNo(built-in proxy)URL

The URL of a server that acts as a reverse proxy for s.pximg.net.

PIXIVFE_UGOIRAPROXY ​

YAML nameEnvironment variableRequiredDefaultOptions
ugoiraProxyPIXIVFE_UGOIRAPROXYNo(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 nameEnvironment variableRequiredDefaultOptions
tokenLoadBalancingPIXIVFE_TOKEN_LOAD_BALANCINGNoround-robinround-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 nameEnvironment variableRequiredDefaultOptions
tokenBaseTimeoutPIXIVFE_TOKEN_BASE_TIMEOUTNo1000mstime.Duration

Initial backoff duration on token failure.

PIXIVFE_TOKEN_MAX_BACKOFF_TIME ​

YAML nameEnvironment variableRequiredDefaultOptions
tokenMaxBackoffTimePIXIVFE_TOKEN_MAX_BACKOFF_TIMENo32000mstime.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 nameEnvironment variableRequiredDefaultOptions
maxAgePIXIVFE_CACHE_CONTROL_MAX_AGENo30stime.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 nameEnvironment variableRequiredDefaultOptions
staleWhileRevalidatePIXIVFE_CACHE_CONTROL_STALE_WHILE_REVALIDATENo60stime.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 nameEnvironment variableRequiredDefaultOptions
acceptLanguagePIXIVFE_ACCEPTLANGUAGENoen-US,en;q=0.5Accept-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.

YAML nameEnvironment variableRequiredDefaultOptions
popularSearchPIXIVFE_POPULAR_SEARCHNofalseBoolean

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 nameEnvironment variableRequiredDefaultOptions
fastTagSuggestionsPIXIVFE_FAST_TAG_SUGGESTIONSNofalseBoolean

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 nameEnvironment variableRequiredDefaultOptions
openAllButtonPIXIVFE_OPEN_ALL_BUTTONNofalseBoolean

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 nameEnvironment variableRequiredDefaultOptions
atomFeedsPIXIVFE_ATOM_FEEDSNotrueBoolean

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 nameEnvironment variableRequiredDefaultOptions
repoUrlPIXIVFE_REPO_URLNohttps://gitlab.com/pixivfe/PixivFEURL

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 nameEnvironment variableRequiredDefaultOptions
-HTTPS_PROXYNo-Proxy URL

Proxy server used for requests made over HTTPS.

HTTP_PROXY ​

YAML nameEnvironment variableRequiredDefaultOptions
-HTTP_PROXYNo-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 nameEnvironment variableRequiredDefaultOptions
strictMissingKeysPIXIVFE_STRICT_MISSING_KEYSNofalseBoolean

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 nameEnvironment variableRequiredDefaultOptions
logLevelPIXIVFE_LOG_LEVELNoinfodebug, 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 (including 5xx responses, 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 nameEnvironment variableRequiredDefaultOptions
logOutputsPIXIVFE_LOG_OUTPUTSNo/dev/stderrArray/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:

sh
PIXIVFE_LOG_OUTPUTS=/dev/stderr,/var/log/pixivfe.log

Config file format:

yaml
log:
  logOutputs:
    - /dev/stderr
    - /var/log/pixivfe.log

PIXIVFE_LOG_FORMAT ​

YAML nameEnvironment variableRequiredDefaultOptions
logFormatPIXIVFE_LOG_FORMATNoconsoleconsole, json

Determines the format of log messages.

  • console uses human-readable timestamps and compact HTTP request lines. Colors are enabled for each terminal output unless NO_COLOR is set to a non-empty value.
  • json writes 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 nameEnvironment variableRequiredDefaultOptions
inDevelopmentPIXIVFE_DEVNofalseBoolean

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 nameEnvironment variableRequiredDefaultOptions
saveResponsesPIXIVFE_SAVE_RESPONSESNofalseBoolean

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 nameEnvironment variableRequiredDefaultOptions
responseSaveLocationPIXIVFE_RESPONSE_SAVE_LOCATIONNo/tmp/pixivfe/responsesFile path

Defines where responses from the pixiv API are saved when PIXIVFE_SAVE_RESPONSES is enabled.