Deploying the No-Code Architects Toolkit API on a Contabo VPS with MinIO

Deploying the No-Code Architects Toolkit API on a Contabo VPS with MinIO


The No-Code Architects Toolkit API is a free, open-source solution for media processing, automation, and cloud storage integration. By deploying it on a Contabo VPS with MinIO as an S3-compatible object storage, you can create a cost-effective, self-hosted environment. Contabo’s affordable VPS plans, featuring NVMe SSDs and global data centers, are ideal for this Flask-based Python API. This guide walks you through setting up MinIO and the toolkit, designed for users with basic Linux and Docker skills.




Prerequisites

  • Contabo VPS: At least 4 vCPUs, 8 GB RAM, 200 GB SSD (e.g., VPS M at ~€7.99/month).
  • Domain name (optional, for custom API access).
  • SSH client (e.g., PuTTY, Terminal).
  • Basic Linux and Docker knowledge.
  • GitHub account for repository access.
  • API key for toolkit authentication.



Step 1: Set Up Your Contabo VPS



1.1 Purchase and Configure

  1. Visit contabo and select a VPS plan (e.g., VPS M).
  2. Choose a data center (Europe, US, Asia) and Ubuntu 22.04 LTS.
  3. Save the emailed VPS IP, root username, and password.
  4. Log in to the Contabo Customer Control Panel and set a hostname (e.g., nca-toolkit-vps).



1.2 Connect and Secure

  1. SSH into your VPS:
   ssh root@YOUR_VPS_IP
Enter fullscreen mode

Exit fullscreen mode

  1. Update packages:
   sudo apt-get update && sudo apt-get upgrade -y
Enter fullscreen mode

Exit fullscreen mode

  1. Create a non-root user:
   adduser nca-user
   usermod -aG sudo nca-user
Enter fullscreen mode

Exit fullscreen mode

  1. Reconnect as nca-user:
   ssh nca-user@YOUR_VPS_IP
Enter fullscreen mode

Exit fullscreen mode




Step 2: Install Docker and Dependencies

  1. Install Docker and Docker Compose:
   sudo apt-get update
   sudo apt-get install -y docker.io docker-compose
Enter fullscreen mode

Exit fullscreen mode

  1. Start and enable Docker:
   sudo systemctl start docker
   sudo systemctl enable docker
Enter fullscreen mode

Exit fullscreen mode

  1. Add user to Docker group:
   sudo usermod -aG docker nca-user
Enter fullscreen mode

Exit fullscreen mode

Log out and back in.

  1. Verify Docker:
   docker --version
   docker run hello-world
Enter fullscreen mode

Exit fullscreen mode

  1. Install Git:
   sudo apt-get install -y git
Enter fullscreen mode

Exit fullscreen mode




Step 3: Install and Configure MinIO

MinIO provides S3-compatible storage for the toolkit.

  1. Create a data directory:
   mkdir -p ~/minio-data
Enter fullscreen mode

Exit fullscreen mode

  1. Run MinIO:
   docker run -d -p 9000:9000 -p 9001:9001 --name minio \
     -v ~/minio-data:/data \
     -e MINIO_ROOT_USER=admin \
     -e MINIO_ROOT_PASSWORD=password123 \
     quay.io/minio/minio server /data --console-address ":9001"
Enter fullscreen mode

Exit fullscreen mode

Use a secure password instead of password123.

  1. Verify MinIO:

     docker ps
    
  • Access console at http://YOUR_VPS_IP:9001 (username: admin, password: password123).
    1. Configure MinIO:
  • Create a bucket named nca-toolkit.
  • Generate access and secret keys:
    • Navigate to Users > Create User.
    • Save the Access Key and Secret Key (or use admin/password123 for testing).
      1. Open ports:
   sudo ufw allow 9000
   sudo ufw allow 9001
Enter fullscreen mode

Exit fullscreen mode




Step 4: Clone the Repository

  1. Clone the toolkit:
   cd ~
   git clone https://github.com/stephengpope/no-code-architects-toolkit.git
   cd no-code-architects-toolkit
Enter fullscreen mode

Exit fullscreen mode

  1. Key files:
    • Dockerfile: Builds the image.
    • app.py: Flask app.
    • requirements.txt: Dependencies.



Step 5: Configure Environment Variables

  1. Generate an API key:
   openssl rand -hex 16
Enter fullscreen mode

Exit fullscreen mode

Save as your_api_key.

  1. Set variables for MinIO:
    • S3_ENDPOINT_URL: http://YOUR_VPS_IP:9000
    • S3_ACCESS_KEY: MinIO access key
    • S3_SECRET_KEY: MinIO secret key
    • S3_BUCKET_NAME: nca-toolkit
    • S3_REGION: None
    • Optional: MAX_QUEUE_LENGTH=10, GUNICORN_WORKERS=4, GUNICORN_TIMEOUT=300, LOCAL_STORAGE_PATH=/tmp
  2. Create .env (optional):
   nano .env
Enter fullscreen mode

Exit fullscreen mode

Add:

   API_KEY=your_api_key
   S3_ENDPOINT_URL=http://YOUR_VPS_IP:9000
   S3_ACCESS_KEY=your_access_key
   S3_SECRET_KEY=your_secret_key
   S3_BUCKET_NAME=nca-toolkit
   S3_REGION=None
   LOCAL_STORAGE_PATH=/tmp
   MAX_QUEUE_LENGTH=10
   GUNICORN_WORKERS=4
   GUNICORN_TIMEOUT=300
Enter fullscreen mode

Exit fullscreen mode

Save and exit.




Step 6: Build and Run the Toolkit

  1. Build the image:
   docker build -t no-code-architects-toolkit .
Enter fullscreen mode

Exit fullscreen mode

  1. Run the container:
   docker run -d -p 8080:8080 --name nca-toolkit \
     -e API_KEY=your_api_key \
     -e S3_ENDPOINT_URL=http://YOUR_VPS_IP:9000 \
     -e S3_ACCESS_KEY=your_access_key \
     -e S3_SECRET_KEY=your_secret_key \
     -e S3_BUCKET_NAME=nca-toolkit \
     -e S3_REGION=None \
     -e LOCAL_STORAGE_PATH=/tmp \
     -e MAX_QUEUE_LENGTH=10 \
     -e GUNICORN_WORKERS=4 \
     -e GUNICORN_TIMEOUT=300 \
     stephengpope/no-code-architects-toolkit:latest
Enter fullscreen mode

Exit fullscreen mode

  1. Verify:
   docker ps
   docker logs nca-toolkit
Enter fullscreen mode

Exit fullscreen mode

  1. Open port:
   sudo ufw allow 8080
Enter fullscreen mode

Exit fullscreen mode



Step 8: Configure Domain and SSL (Optional)

  1. Point domain to YOUR_VPS_IP via DNS A record.
  2. Install Nginx:
   sudo apt-get install -y nginx
Enter fullscreen mode

Exit fullscreen mode

Configure:

   sudo nano /etc/nginx/sites-available/nca-toolkit
Enter fullscreen mode

Exit fullscreen mode

Add:

   server {
       listen 80;
       server_name your_domain.com;

       location / {
           proxy_pass http://localhost:8080;
           proxy_set_header Host $host;
           proxy_set_header X-Real-IP $remote_addr;
       }
   }
Enter fullscreen mode

Exit fullscreen mode

Enable:

   sudo ln -s /etc/nginx/sites-available/nca-toolkit /etc/nginx/sites-enabled/
   sudo nginx -t
   sudo systemctl restart nginx
Enter fullscreen mode

Exit fullscreen mode

  1. Add SSL:
   sudo apt install -y certbot python3-certbot-nginx
   sudo certbot --nginx -d your_domain.com
Enter fullscreen mode

Exit fullscreen mode

  1. Test: https://your_domain.com/v1/toolkit/test.



Step 9: Optimize and Maintain

  1. Performance: Monitor with htop or glances:
   sudo apt install -y htop glances
Enter fullscreen mode

Exit fullscreen mode

  1. Backups: Use Contabo snapshots or toolkit’s /v1/s3/upload.
  2. Security:

    • Update: sudo apt-get update && sudo apt-get upgrade -y.
    • Restrict SSH: sudo ufw allow from YOUR_IP to any port 22.
  3. Monitoring: Use Contabo’s API or Prometheus.



Step 10: Join the Community

Join the No-Code Architects Community for support, courses, and networking. Contribute via GitHub by forking and submitting pull requests to the build branch.




Conclusion

Deploying the No-Code Architects Toolkit API on a Contabo VPS with MinIO offers a scalable, self-hosted solution for media processing. Contabo’s cost-effective VPS and MinIO’s S3 compatibility make it ideal for businesses and creators. Set up in under an hour, optimize with Nginx/SSL, and leverage the community for support. Start building with this free API today!

Resources:



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *