Forge Installation Guide
July 7, 2025 ยท View on GitHub
This guide provides detailed installation instructions for setting up Forge on various platforms.
Table of Contents
Prerequisites
Before installing Forge, ensure you have the following:
- Python 3.8+ installed
- pip (Python package manager)
- git for cloning the repository
- Docker (optional, for containerized installation)
Installation Methods
Quick Setup Script
The quickest way to get started with Forge is to use the provided setup script:
-
Clone the repository:
git clone https://github.com/yourusername/forge.git cd forge -
Run the setup script:
chmod +x setup.sh ./setup.sh -
Start the server:
python run.py
The setup script performs the following actions:
- Creates a Python virtual environment
- Installs all required dependencies
- Creates a
.envfile from.env.example - Generates secure random keys for encryption and JWT
- Runs database migrations
- Sets up the initial database structure
Manual Installation
If you prefer more control over the installation process, follow these steps:
-
Clone the repository:
git clone https://github.com/yourusername/forge.git cd forge -
Create a virtual environment:
python -m venv venv -
Activate the virtual environment:
- On Linux/macOS:
source venv/bin/activate - On Windows:
venv\Scripts\activate
- On Linux/macOS:
-
Install dependencies:
pip install -r requirements.txt -
Create a
.envfile:cp .env.example .env -
Generate secure keys:
python -c "import os; from base64 import b64encode; print(f'API_KEY_ENCRYPTION_KEY={b64encode(os.urandom(32)).decode()}')" python -c "import os; from base64 import b64encode; print(f'JWT_SECRET_KEY={b64encode(os.urandom(32)).decode()}')" -
Add the generated keys to your
.envfile. -
Run database migrations:
alembic upgrade head -
Start the server:
python run.pyor
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000
Docker Installation
For a containerized deployment:
-
Clone the repository:
git clone https://github.com/yourusername/forge.git cd forge -
Build and start with Docker Compose:
docker-compose up -d -
To view logs:
docker-compose logs -f -
To stop the service:
docker-compose down
Platform-Specific Instructions
Linux
For Debian/Ubuntu-based distributions:
-
Install system dependencies:
sudo apt update sudo apt install -y python3 python3-pip python3-venv git -
Follow the Manual Installation or Quick Setup Script instructions.
macOS
-
Install Homebrew if not already installed:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" -
Install Python and Git:
brew install python git -
Follow the Manual Installation or Quick Setup Script instructions.
Windows
-
Install Python from the official website.
-
Install Git from the official website.
-
Open Command Prompt or PowerShell and follow the Manual Installation steps, with these Windows-specific adjustments:
-
Clone the repository:
git clone https://github.com/yourusername/forge.git cd forge -
Create and activate a virtual environment:
python -m venv venv venv\Scripts\activate -
Continue with the rest of the manual installation steps.
-
Verifying Your Installation
To verify that Forge is installed and running correctly:
-
Open a web browser and navigate to:
http://localhost:8000/docsYou should see the Swagger UI API documentation.
-
Test with the CLI tool:
./forge-cli.py interactiveYou should see the interactive menu prompting you for actions.
Troubleshooting
Common Issues
Problem: ModuleNotFoundError when running the application.
Solution: Ensure the virtual environment is activated and all dependencies are installed:
source venv/bin/activate # On Linux/macOS
venv\Scripts\activate # On Windows
pip install -r requirements.txt
Problem: Database migration errors.
Solution: Try resetting the migrations and starting from scratch:
rm -rf migrations # Be cautious with this command!
alembic init migrations
alembic revision --autogenerate -m "Initial migration"
alembic upgrade head
Problem: Permission errors when running the setup script.
Solution: Ensure the script is executable:
chmod +x setup.sh
Problem: API key encryption errors.
Solution: Check that your .env file contains valid base64-encoded encryption keys:
python -c "import os; from base64 import b64encode; print(f'API_KEY_ENCRYPTION_KEY={b64encode(os.urandom(32)).decode()}')"
python -c "import os; from base64 import b64encode; print(f'JWT_SECRET_KEY={b64encode(os.urandom(32)).decode()}')"
Getting Help
If you encounter issues not covered by this guide:
- Check the GitHub Issues to see if others have faced the same problem.
- Search for similar problems in the project discussions.
- Open a new issue if your problem hasn't been addressed yet.
Next Steps
After installation, refer to:
- User Guide for instructions on using Forge
- Contributing Guide if you want to contribute to the project
- API Documentation for API details