Back to articles
AI & Cloud

Deploy Meilisearch on VPS: Lightning-Fast Search Tool for Business Websites

Guide to deploying Meilisearch on VPS for fast, accurate search on business websites. Includes configuration, optimization, and integration with web applications.

DPTCloud Engineering4 min read
Deploy Meilisearch on VPS: Lightning-Fast Search Tool for Business Websites

Image credit: Firmbee · Pixabay Content License

Introduction to Meilisearch and Benefits for Business Websites

Meilisearch is an open-source search engine designed to deliver fast, accurate, and easy-to-integrate search experiences for business websites. With response times in milliseconds, it significantly improves search performance on web applications, especially those with large datasets such as e-commerce platforms, content management systems (CMS), or knowledge bases.

Compared to traditional search tools like Elasticsearch or Algolia, Meilisearch stands out for its simplicity, rapid setup, and built-in auto-optimization of search queries. It performs efficiently even on VPS environments with limited resources, helping businesses reduce costs while maintaining high performance.

Prerequisites and Preparation

To deploy Meilisearch on a VPS, you will need:

  • A VPS running Ubuntu 20.04 or 22.04 (minimum 2GB RAM, 2 vCPUs)
  • SSH access to the VPS
  • Installed curl and docker (or Docker Compose)
  • Port 7700 (default Meilisearch port) not blocked by firewall

Deploy Meilisearch on VPS Using Docker

Meilisearch offers a quick deployment method via Docker, which is the most common and straightforward approach for running the search engine on VPS.

Step 1: Install Docker (if not already installed)

# Update package list
sudo apt update

# Install required packages
sudo apt install -y apt-transport-https ca-certificates curl software-properties-common

# Add Docker GPG key
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

# Add Docker repository
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

# Update package list and install Docker
sudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io

Step 2: Run Meilisearch with Docker

# Create data directory
mkdir -p ~/meilisearch/data

# Run Meilisearch with Docker
docker run -d \
  --name meilisearch \
  -p 7700:7700 \
  -v ~/meilisearch/data:/data/meilisearch-data \
  meilisearch/meilisearch:latest \
  meilisearch --host 0.0.0.0 --port 7700

The search engine will start and listen on port 7700. You can check the status with:

docker logs meilisearch

Integrate Meilisearch with Web Applications

To integrate the search engine into a web application, follow these steps:

  • Set up a data source (e.g., MySQL, MongoDB, or JSON)
  • Synchronize data to Meilisearch using its API or SDK
  • Integrate the search interface into your web app

Example: Sync data from JSON to Meilisearch

{
  "documents": [
    {
      "id": "1",
      "title": "Guide to Deploy Meilisearch on VPS",
      "content": "Detailed guide on deploying Meilisearch on VPS for businesses."
    },
    {
      "id": "2",
      "title": "Optimizing Search with Meilisearch",
      "content": "Techniques to optimize search performance on Meilisearch."
    }
  ]
}

Run the command to add data:

curl -X POST 'http://localhost:7700/indexes/documents/documents' \
  -H 'Content-Type: application/json' \
  -d @documents.json

Authentication and Activity Verification

After deployment, verify that the search engine is working by:

  • Accessing http://:7700 to view the admin interface
  • Performing a simple search query:
curl -X GET 'http://localhost:7700/search?q=meilisearch'

Common Troubleshooting Solutions

Issue Solution
Cannot access port 7700 Check firewall (UFW or iptables) and open port 7700
Meilisearch fails to start Check logs with docker logs meilisearch
Data not syncing Ensure API endpoint is correct and data is properly formatted

References

DPTCloud Tier III Infrastructure

High-RAM Cloud VPS Plans Optimized for AI, Databases & Cache

Enterprise RAID 10 NVMe SSDs, CMC & FPT District 9 uplinks with Anycast Anti-DDoS and 99.99% SLA.

View 22 VPS Plans
ECO · vn-02Recommended

VPS-4E

297.000 ₫ / mo

10% VAT included

  • CPU: 4 vCPU
  • RAM: 8 GB
  • SSD: 50 GB NVMe
ECO · vn-02

VPS-5E

614.900 ₫ / mo

10% VAT included

  • CPU: 8 vCPU
  • RAM: 16 GB
  • SSD: 100 GB NVMe
ADVANCED · vn-03Recommended

VPS-4T

548.900 ₫ / mo

10% VAT included

  • CPU: 4 vCPU
  • RAM: 8 GB
  • SSD: 50 GB NVMe

Related Articles

View all
ZaloZalo SupportDiscord0384 753 478