Ditch your AI subscriptions…host them yourself! (cheaper + unlimited access)

3 min read 3 days ago
Published on Mar 13, 2025 This response is partially generated with the help of AI. It may contain inaccuracies.

Table of Contents

Introduction

In this tutorial, we will guide you through the process of self-hosting AI models using OpenWebUI on a VPS (Virtual Private Server) with Hostinger. By following these steps, you can save money on AI subscriptions while enjoying unlimited access to major AI models like ChatGPT, Claude, and Gemini. This setup enhances your control over privacy and security, making it an ideal solution for personal or team use.

Step 1: Set Up Your VPS

  1. Choose a VPS Provider:

    • We recommend using Hostinger for its affordability and reliability. You can get started with a plan that suits your needs.
  2. Create an Account:

    • Sign up for a Hostinger account. Use the code networkchuck10 for any discounts available.
  3. Select and Configure Your VPS:

    • Choose the appropriate VPS plan based on your expected usage.
    • Configure the server settings, including the operating system (Ubuntu is a popular choice).
  4. Access Your VPS:

    • Once your VPS is set up, access it via SSH using a terminal or an SSH client like PuTTY.
    • Use the following command to connect:
      ssh username@your_vps_ip
      

Step 2: Install OpenWebUI

  1. Update Your System:

    • Before installing any software, update your package list with:
      sudo apt update && sudo apt upgrade -y
      
  2. Install Required Dependencies:

    • Make sure you have Git and Node.js installed. Run:
      sudo apt install git nodejs npm -y
      
  3. Clone the OpenWebUI Repository:

    • Use Git to clone the OpenWebUI repository:
      git clone https://github.com/OpenWebUI/OpenWebUI.git
      cd OpenWebUI
      
  4. Install OpenWebUI:

    • Install the necessary packages for OpenWebUI:
      npm install
      
  5. Start OpenWebUI:

    • Launch OpenWebUI using:
      npm start
      

Step 3: Connect to ChatGPT API

  1. Obtain API Key:

    • Sign up for an API key from OpenAI to access ChatGPT.
  2. Configure the API Key:

    • Navigate to the OpenWebUI configuration file (typically a .env file) and add your API key:
      OPENAI_API_KEY=your_api_key_here
      
  3. Restart OpenWebUI:

    • After saving changes, restart OpenWebUI to apply the new settings:
      npm restart
      

Step 4: Explore Additional Features

  1. Use LiteLLM:

    • Explore LiteLLM to enhance the capabilities of your AI hub. Follow the relevant installation instructions provided in the OpenWebUI documentation.
  2. Integrate Other Models:

    • If desired, explore how to integrate other models like Claude or Gemini by following similar steps for obtaining API keys and configuring them in OpenWebUI.

Conclusion

By following these steps, you have successfully set up your own AI hub using OpenWebUI on a VPS. This not only saves you money on AI subscriptions but also gives you greater control over your data and access. You can now invite others to use the platform securely.

For further enhancement, consider exploring the self-hosting documentation linked in the description or look into setting up a domain with SSL for a more polished experience. Enjoy your self-hosted AI journey!