Installation
Option 1: Self-Hosted Deployment
Using Docker from Docker Hub
- Pull & Run the Docker image:
Custom listen port (host and container must match the chosen
docker run -p 8888:8888 -e API_PASSWORD=your_password mhdzumair/mediaflow-proxyPORT):docker run -p 8889:8889 -e PORT=8889 -e API_PASSWORD=your_password mhdzumair/mediaflow-proxy
Using Docker Compose
- Set the
API_PASSWORDand other environment variables in.env:
echo "API_PASSWORD=your_password" > .env
docker compose up --detach
Using pip
[!IMPORTANT] Ensure that you have Python 3.10 or higher installed.
-
Install the package:
pip install mediaflow-proxy -
Set the
API_PASSWORDand other environment variables in.env:echo "API_PASSWORD=your_password" > .env -
Run the MediaFlow Proxy server:
You can access the server atmediaflow-proxyhttp://localhost:8888(orhttp://localhost:$PORTif you set thePORTenvironment variable). -
To run the server with uvicorn options: (Optional)
uvicorn mediaflow_proxy.main:app --host 0.0.0.0 --port 8888 --workers 4 --forwarded-allow-ips "*"
Note
Omit
--forwarded-allow-ips "*"when running locally.
Using git & uv
[!IMPORTANT] Ensure that you have Python 3.10 or higher and uv installed.
-
Clone the repository:
git clone https://github.com/mhdzumair/mediaflow-proxy.git cd mediaflow-proxy -
Install dependencies using uv:
uv sync -
Set the
API_PASSWORDenvironment variable in.env:echo "API_PASSWORD=your_password" > .env -
Run the FastAPI server:
uv run uvicorn mediaflow_proxy.main:app --host 0.0.0.0 --port 8888 --workers 4 --forwarded-allow-ips "*"
Note
Omit
--forwarded-allow-ips "*"when running locally.
Build and Run Docker Image Locally
-
Build the Docker image:
docker build -t mediaflow-proxy . -
Run the Docker container:
Example with a non-default port:docker run -d -p 8888:8888 -e API_PASSWORD=your_password --restart unless-stopped --name mediaflow-proxy mediaflow-proxydocker run -d -p 8889:8889 -e PORT=8889 -e API_PASSWORD=your_password --restart unless-stopped --name mediaflow-proxy mediaflow-proxy
Option 2: Premium Hosted Service (ElfHosted)
For a hassle-free, high-performance deployment of MediaFlow Proxy, consider the premium hosted service through ElfHosted.
To purchase: 1. Visit https://store.elfhosted.com/product/mediaflow-proxy 2. Follow ElfHosted's setup instructions
Benefits: - Instant setup and automatic updates - High performance and 24/7 availability - No server maintenance required
Ideal for users who want a reliable, plug-and-play solution without the technical overhead of self-hosting.
Option 3: Hugging Face Space Deployment (Guide from a MediaFlow Contributor)
- Go to this repo and create a fork: https://github.com/UrloMythus/UnHided
- Sign up or log in to Hugging Face: https://huggingface.co/
- Create a new space with a random name: https://huggingface.co/new-space. Choose Docker as SDK and blank template and public visibility.
- Go to the "Settings" tab and create a new secret with the name
API_PASSWORDand set the value to your desired password. - Go to the "Files" tab and create a new file with the name
Dockerfileand paste the following content. After that, replaceYourUsername/YourRepoNamein the Dockerfile with your username and the name of your fork. Finally, click on "Commit" to save the changes. Remember, your space might get banned if instead of using your fork, you use the main repo.FROM python:3.11-slim-bullseye WORKDIR /app RUN apt-get update && apt-get install -y git RUN git clone https://github.com/YourUsername/YourRepoName.git . RUN pip install --no-cache-dir -r requirements.txt EXPOSE 7860 CMD ["uvicorn", "run:main_app", "--host", "0.0.0.0", "--port", "7860", "--workers", "4"] - Wait until the space gets built and deployed. Don't panic if you see "Your app is running" instead of the usual mediaflowproxy page. You can still use it as usual.
- If the space is deployed successfully, you can click on the three dots in the top right corner and click on "Embed this space" and copy the "Direct URL".
- To update your proxy to the newest release, go to your GitHub fork and click on Sync. After that, hop on your Hugging Face Space -> Settings and click on Factory Rebuild.
- Use the above URL and API password on support addons like MediaFusion, MammaMia, Jackettio, etc.