What Is the Default Port for ReClip? Configuration Guide for Flask Deployment
The default port for ReClip is 8899, used by its Flask web server unless overridden by the PORT environment variable.
ReClip is an open-source web application built on Flask. Understanding its default port configuration is essential for containerized deployments, reverse proxy setups, and avoiding port conflicts in development environments. This guide explains how the port is defined in the source code and how to customize it for your infrastructure.
Where the Default Port Is Defined
The port configuration resides in app.py at line 208 of the ReClip repository. The implementation uses Python's os.environ.get() with a fallback value:
port = int(os.environ.get("PORT", 8899))
app.run(host=host, port=port)
This pattern follows the 12-factor app methodology, allowing environment-based configuration without code changes. The PORT variable is checked first; if absent or unset, the integer 8899 becomes the active port.
How to Run ReClip with the Default Port
No configuration is required to use the default port. Start the application using either method:
# Using Docker Compose
docker-compose up
# Using the provided startup script
./reclip.sh
Both commands launch ReClip listening on 0.0.0.0:8899 inside the container.
How to Override the ReClip Default Port
Method 1: Export Before Running
export PORT=8080
docker-compose up
Method 2: Inline Environment Variable
PORT=8080 ./reclip.sh
Method 3: Docker Compose Port Mapping
The docker-compose.yml file controls host-to-container port mapping independently of the internal port:
services:
reclip:
build: .
ports:
- "8899:8899" # host:container (default)
To expose ReClip on a different host port while keeping the internal default:
- "8080:8899" # external requests to :8080 → internal :8899
Or change both the environment variable and the mapping:
environment:
- PORT=5000
ports:
- "80:5000"
ReClip Port Configuration Files
| File | Location | Purpose |
|---|---|---|
app.py |
app.py:208 |
Flask entry point; defines 8899 fallback |
reclip.sh |
reclip.sh |
Shell startup script; propagates PORT if set |
docker-compose.yml |
docker-compose.yml |
Orchestrates container port exposure |
Summary
- Default ReClip port is 8899, hardcoded as fallback in
app.py - Override via
PORTenvironment variable for any deployment scenario - Docker Compose port mapping (
host:container) operates independently from the internal port setting - All configuration is environment-driven with no source code modifications needed
Frequently Asked Questions
What happens if port 8899 is already in use on my system?
ReClip will fail to start with a socket.error or Address already in use exception. Run PORT=9000 ./reclip.sh (or any available port) to resolve the conflict.
Can I use ReClip behind Nginx or another reverse proxy?
Yes. Keep PORT=8899 internally and configure your reverse proxy to forward traffic to that port. The external port exposed via Docker Compose or Nginx can differ from the internal ReClip port.
Does the reclip.sh script modify the default port behavior?
No. The script only exports PORT if already set in the environment; it does not override the 8899 default itself. The fallback logic remains exclusively in app.py.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →