Sign inSign up

cueplex/plainext

By cueplex

•Updated 10 days ago

Plex Middleware. Stands in front of your plex server allowing altering of native apps. AI Search

Image
Machine learning & AI
Web servers
0

1.5K

cueplex/plainext repository overview

⁠plAInext — AI Search Proxy for Plex

A self-hosted proxy that sits in front of Plex and replaces search results and Home rows with AI-ranked ones. Playback stays 100% native — nothing to install on your TV or phone.


⁠Deploy

services:
  plainext-proxy:
    image: cueplex/plainext:latest
    container_name: plainext-proxy
    restart: unless-stopped
    ports:
      - "8099:8099"     # Plex proxy
      - "32501:32501"   # Admin UI
    volumes:
      - plainext-data:/app/data
    extra_hosts:
      - "host.docker.internal:host-gateway"

volumes:
  plainext-data:
docker compose up -d

⁠Setup

⁠1. Open the admin console

Go to http://your-server-ip:32501 and sign in with your Plex owner account.


⁠2. Set your Plex server URL

Connect tab → Plex server — enter the address the container uses to reach Plex, then Test and Save.

Plex locationURL to enter
Same machine (native or Docker)http://host.docker.internal:32400
Different machine on LANhttp://192.168.x.x:32400
Plex in Docker on a shared networkhttp://plex-container-name:32400

⁠3. Configure your reverse proxy

Point nginx / Nginx Proxy Manager / Caddy at port 8099 for HTTPS and a clean domain.

NPM: create a proxy host for your domain, set the upstream to http://your-server-ip:8099, enable SSL, then paste the following into the Advanced tab:

# Heavy media bypasses Node — prevents socket storms on direct-play/transcode
location ^~ /library/parts/ {
    proxy_pass http://<plex-container>:<plex-port>;
    proxy_http_version 1.1;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_buffering off;
    proxy_request_buffering off;
    proxy_read_timeout 86400s;
    proxy_send_timeout 86400s;
}

location ~* ^/(?:video|audio)/:/transcode/universal/session {
    proxy_pass http://<plex-container>:<plex-port>;
    proxy_http_version 1.1;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_buffering off;
    proxy_request_buffering off;
    proxy_read_timeout 86400s;
    proxy_send_timeout 86400s;
}

location ^~ /photo/:/transcode {
    resolver 127.0.0.11 valid=30s ipv6=off;
    set $photo_up "http://<plex-container>:<plex-port>";
    if ($arg_url ~* "(image\.tmdb\.org|plainext)") { set $photo_up "http://<this-host>:8099"; }
    proxy_pass $photo_up$request_uri;
    proxy_http_version 1.1;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_buffering off;
}

Replace <plex-container> and <plex-port> with your Plex address and port (usually 32400). Replace <this-host> with the address nginx uses to reach plAInext.

Local LAN only? Skip this step. Use http://your-server-ip:8099 directly in step 4.


⁠4. Set your public URL in plAInext

Connect tab → Public URL — enter the full address clients reach the proxy at.

  • With reverse proxy: https://plex.yourdomain.com
  • LAN only: http://your-server-ip:8099

⁠5. Add the proxy URL in Plex

Plex Web → Settings → Network → Custom server access URLs → add the same URL from step 4.

Set Secure connections to Preferred (not Required).


⁠6. Disable Plex Remote Access

Plex Web → Settings → Remote Access → uncheck Enable Remote Access → Save.

This is required. With Remote Access on, Plex advertises a direct plex.direct address alongside your proxy URL, and clients will prefer it — bypassing the proxy entirely. Your reverse proxy from step 3 handles remote access instead.


⁠7. Reload Plex

Restart your Plex app. Traffic now flows through plAInext. Search and Home rows will be AI-ranked once you add an AI provider key in the AI & Usage tab.


⁠Reverting

  1. Plex → Settings → Network → Custom server access URLs → clear it → Save
  2. Plex → Settings → Remote Access → re-enable
  3. docker compose down

If not able to access via app.plex.tv during revert, you should be able to access at your public proxy url you have setup. Supposing you still have an nginx rule to forward the traffic

Plex behaves exactly as before.


⁠Key environment variables

VariableDefaultDescription
PROXY_PORT8099Port Plex clients connect to
PROXY_CONFIG_PORT32501Admin UI port
ENCRYPTION_KEYauto-generated64-char hex — set manually to survive container recreations

Tag summary

Content type

Image

Digest

sha256:7a88ce375…

Size

102.9 MB

Last updated

10 days ago

docker pull cueplex/plainext