PCBHub
January 6, 20266 min read 0 views

How to Self-Host PCBHub: A Step-by-Step Guide to Deployment

pcbhub
pcbhub
Author
How to Self-Host PCBHub: A Step-by-Step Guide to Deployment

Hi! I’m a developer at PCBHub, and I’m here to help you set up your own instance of the platform. This guide is designed for hardware engineers, makers, and startups who want full control over their data but might not be professional DevOps engineers.

By the end of this article, you’ll have a private, secure environment to manage your PCB designs, collaborate with your team, and automate your technical documentation.

The Complete Guide to Self-Hosting PCBHub: From Server Rental to Production

PCBHub is the "GitHub + Google Docs + Figma" hybrid for electronics. While we offer a cloud version, self-hosting is the preferred choice for teams working on proprietary hardware who need 100% data sovereignty.

Step 1: Choosing and Renting a Server (VPS)

First, you need a "computer in the cloud" that stays on 24/7. This is called a VPS (Virtual Private Server).

  1. Recommended Providers: DigitalOcean, Linode (Akamai), AWS, or Hetzner.

  2. Operating System: Choose Ubuntu 22.04 LTS or 24.04 LTS.

  3. Minimum Hardware Specs:

    • RAM: 2 GB (Minimum), 4 GB (Recommended for heavy PDF/KiCad processing).

    • CPU: 1-2 Cores.

    • Storage: 20 GB+ (SSD preferred).

Once you purchase the VPS, you will receive an IP address (e.g., 123.45.67.89) and a password (or SSH key).

Step 2: Connecting and Preparing the OS

Open your terminal (PowerShell on Windows, Terminal on macOS/Linux) and connect to your server:

ssh root@your_server_ip

Once logged in, update the system to ensure you have the latest security patches:

sudo apt update && sudo apt upgrade -y

Step 3: Installing Docker

Docker allows us to run PCBHub in "containers." Think of it like a virtual box that has everything (database, code, libraries) pre-configured so you don't have to install them manually.

Install Docker using this official script:

curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh

Verify the installation:

docker --version

Step 4: Getting the PCBHub Files

Now, download the official deployment configuration from our repository:

git clone https://github.com/Evgeniy-Developer-droid/PCBHub_self_hosting.git
cd PCBHub_self_hosting

Step 5: Configuring Your Environment (.env)

The server needs to know your security keys and database passwords. We store these in a hidden file called .env.

Create the file from the template:

cp .env.example .env

Open it for editing:

nano .env

Key variables to update:

  • POSTGRES_PASSWORD: Create a strong password for your database.

  • DATABASE_URL: Update the password in this string to match the one above.

  • SECRET_KEY: Enter a long, random string (this secures user sessions).

  • FRONTED_URL & BACKEND_URL: If you have a domain (e.g., pcb.yourcompany.com), enter it here. If not, use http://your_server_ip:3000 and http://your_server_ip:8000.

Press Ctrl+O, Enter to save, and Ctrl+X to exit.

Step 6: Launching the Platform

This single command will download the PCBHub images and start the Frontend, Backend, Database (PostgreSQL), Cache (Redis), and Task Workers (Celery).

docker compose up -d

Give it a minute or two to initialize.

Test it: Open your browser and go to http://your_server_ip:3000. You should see the PCBHub login screen!

Step 7: Setting up Nginx and HTTPS (Production Setup)

By default, the site runs on ports :3000 and :8000. To make it professional (e.g., https://pcbhub.yourcompany.com), we use Nginx as a reverse proxy.

  1. Install Nginx:

    sudo apt install nginx -y
    
  2. Configure the Domain: Create a configuration file:

    sudo nano /etc/nginx/sites-available/pcbhub
    

    Paste this configuration (replacing yourdomain.com with your actual domain):

server {
    listen 80;
    server_name yourdomain.com;

    location / {
        proxy_pass http://localhost:3000;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
    }

    location /api {
        proxy_pass http://localhost:8000;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
    }
}
  1. Activate and get SSL (HTTPS):

    sudo ln -s /etc/nginx/sites-available/pcbhub /etc/nginx/sites-enabled/
    sudo systemctl restart nginx
    sudo apt install certbot python3-certbot-nginx -y
    sudo certbot --nginx -d yourdomain.com
    

Keeping Your PCBHub Up to Date

We release updates frequently with new engineering calculators and KiCad support. To update your self-hosted version:

docker compose pull
docker compose up -d
docker compose exec backend alembic upgrade head

Need Assistance?

We know that server management can be tricky for hardware-focused teams. If you run into any issues:

  • Docker installation errors?

  • Difficulty setting up S3 storage for large project files?

  • Questions about team permissions?

The PCBHub Support Team is here to help! Visit us at pcbhub.org or open an issue on our GitHub repository. We can guide you through the setup or provide custom enterprise configurations.

Let's build better hardware together!

Enjoyed this article?

Support the author by leaving a like.