Tutorial Docker Self-Hosting

How to Install Laravel GPT on Your Own Server (Step-by-Step Guide)

Marcus Thorne

Marcus Thorne

DevOps Engineer

Published

January 25, 2026

Read Time

16 min read

How to Install Laravel GPT on Your Own Server (Step-by-Step Guide)

The dream of having a fully functional, private AI workspace is no longer a futuristic concept—it is a reality you can achieve in about 20 minutes. If you are tired of monthly SaaS fees, data privacy concerns, and the unpredictability of third-party AI providers, self-hosting is the ultimate solution.

Setting up Laravel GPT on your own server is designed to be a straightforward process, even if you aren’t a seasoned DevOps professional. Thanks to Docker and the streamlined Ollama integration, we’ve abstracted away the complexity of managing AI models and web servers. This guide will walk you through the entire process, from selecting the right hardware to making your first AI-generated query.

Why Self-Host Laravel GPT?

Before we dive into the commands, let’s briefly touch on why this is the right move for you. Unlike using a hosted API, self-hosting gives you:

  • Total Data Sovereignty: Your data never leaves your server.
  • Zero Marginal Cost: After the initial setup, your only cost is electricity or your monthly VPS fee.
  • Customizability: You can fine-tune the environment to your specific needs.
  • Always-On Availability: Your AI is available whenever your server is running, regardless of whether a third-party service is experiencing an outage.

Part 1: System Requirements - Giving Your AI Room to Breathe

AI models are “compute-heavy.” To have a smooth experience, your server needs a bit of “muscle.” While Laravel GPT itself is very efficient, the AI models (LLMs) managed by Ollama require significant RAM and CPU/GPU power.

Minimum Specifications (The “Lightweight” Build)

  • RAM: 8 GB. This is enough to run smaller models like Llama 3 8B or Mistral 7B.
  • CPU: 4 vCPU. Responses might be a bit slow (2-5 words per second), but it’s usable for simple tasks.
  • Disk: 50 GB SSD. Models are large, and you need space for your database and assets.
  • OS: Ubuntu 22.04 or 24.04 LTS.
  • RAM: 16 GB to 32 GB. This allows you to run larger models (like Llama 3 70B) or multiple models simultaneously.
  • CPU: 8 vCPU+. Faster text generation and snappier interface response.
  • GPU: NVIDIA GPU with 8GB+ VRAM (e.g., RTX 3060, 4070, or A10G on cloud). This is the single biggest upgrade you can make. A GPU will make AI responses near-instant.
  • Disk: 100 GB+ NVMe SSD. For fast model loading and storage.

Hosting Options

  1. Cloud VPS (Hetzner, DigitalOcean, Linode): Great for 24/7 availability. Hetzner’s dedicated vCPU plans are excellent for price-to-performance.
  2. Dedicated GPU Cloud (Lambda Labs, RunPod): If you need extreme performance for image generation.
  3. Local Hardware: An old gaming PC or a Mac M1/M2/M3 with high unified memory makes an incredible local AI server.

Part 2: Preparing the Environment

First, log into your server via SSH and ensure everything is up to date.

sudo apt update && sudo apt upgrade -y

Installing Docker and Git

Laravel GPT is containerized using Docker, which ensures it runs perfectly on any system without conflicting with other software.

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

# Install Docker Compose (if not included)
sudo apt install docker-compose-plugin -y

# Install Git
sudo apt install git -y

Verify your installation:

docker --version
git --version

Part 3: Setting Up the AI Engine (Ollama)

Ollama is the core engine that handles the Large Language Models. While you can run Ollama inside a container, for the best performance (especially with GPU acceleration), we recommend a native installation on the host machine.

# Install Ollama
curl -fsSL https://ollama.com/install.sh | sh

Configuring Ollama for Remote Access

By default, Ollama only listens on localhost. Since Laravel GPT will be talking to it (potentially from within a Docker network), we need to tell Ollama to listen on all interfaces.

  1. Edit the Ollama service configuration: sudo systemctl edit ollama.service
  2. Add these lines:
    [Service]
    Environment="OLLAMA_HOST=0.0.0.0"
    Environment="OLLAMA_ORIGINS=*"
  3. Reload and restart:
    sudo systemctl daemon-reload
    sudo systemctl restart ollama

Pulling Your First Models

Choose the models you want to use. We recommend starting with Llama 3:

ollama pull llama3
ollama pull deepseek-coder  # Great for programming
ollama pull mistral         # Excellent all-rounder

Part 4: Deploying Laravel GPT

Now it’s time to bring the platform to life.

1. Clone the Repository

git clone https://github.com/laravelgpt/platform.git ~/laravel-gpt
cd ~/laravel-gpt

2. Configure Your Environment Variables

Copy the example file and edit it:

cp .env.example .env
nano .env

Key variables to set:

  • APP_URL: Your domain or server IP (e.g., http://123.456.78.9)
  • DB_PASSWORD: A secure password for your database.
  • OLLAMA_HOST: The internal or external IP of your server (e.g., http://172.17.0.1:11434 if using the Docker bridge IP).

3. Launch with Docker Compose

This command will pull the web server, database, and worker images and start them in the background.

docker compose up -d

4. Run Migrations and Setup

Once the containers are up, we need to set up the database and create your admin account.

# Install dependencies (only required if not using pre-built images)
docker compose exec app composer install

# Run database migrations
docker compose exec app php artisan migrate --seed

Part 5: Final Configuration and Optimization

Creating Your First User

Navigate to http://your-server-ip:8000 (or the port you configured). You will be prompted to create your primary administrator account. From here, you can manage users, view logs, and start chatting.

Setting Up the Image Engine

Laravel GPT supports image generation via Stable Diffusion or Flux. In your dashboard settings, you can point the platform to your preferred image generation API or a local instance of ComfyUI/Automatic1111.

Troubleshooting Common Issues

  • Connection Refused: Ensure your OLLAMA_HOST is correct and the port 11434 is open in your firewall (sudo ufw allow 11434).
  • Slow Responses: Check your CPU/RAM usage with htop. If your RAM is maxed out, you may need to use a smaller model (e.g., a “Quantized” version from the Ollama library).
  • Docker Errors: Use docker compose logs -f to see real-time error messages from the application.

Conclusion: Your Journey Begins

Congratulations! You are now the owner of a private AI infrastructure. You are no longer at the mercy of SaaS pricing or privacy policies.

This installation is just the beginning. From here, you can integrate Laravel GPT into your company’s workflows, build custom AI skills, and scale your content production to heights that were previously impossible or too expensive.

Self-hosting is a journey of empowerment. You’ve taken the first step toward true digital independence. Welcome to the future of AI.

Ready to see what your new AI can do? Head over to your dashboard and start your first conversation.

Our Software Ecosystem

A suite of powerful, developer-centric tools designed to accelerate your workflow and enhance your Laravel applications.

Laravel Mail

Laravel Mail

Advanced email marketing and automation platform. Send campaigns, manage subscribers, and track performance with powerful analytics.

Explore Product
Laravel SEO

Laravel SEO

Comprehensive SEO toolkit for Laravel applications. Optimize meta tags, sitemaps, schema markup, and improve search rankings effortlessly.

Explore Product
Laravel GPT

Laravel GPT

AI-powered Laravel application with GPT integration. Intelligent content generation, automated responses, and smart chatbot capabilities.

Explore Product
Laravel UI

Laravel UI

Premium UI components designed for easy use with Laravel. High-quality Marketing and Application UI blocks built for conversion.

Explore Product