What is Meilisearch and why is it ideal for a VPS?
Meilisearch is a powerful, fast, and flexible open-source search engine that provides instant, relevant search results. It is written in Rust, which ensures high performance and low resource consumption, making it an excellent candidate for deployment on Virtual Private Servers (VPS). By hosting Meilisearch on a VPS, you gain full control over your search infrastructure, can scale it as your project grows, and ensure maximum data privacy. This is an ideal solution for projects requiring fast and reliable search functionality without relying on third-party cloud services, making `meilisearch self-hosted` a preferred option for many developers.Key Features and Benefits of Meilisearch
Meilisearch stands out among other search engines due to a number of advantages:- Instant Search: Results appear almost in real-time as you type your query.
- Relevance by Default: Built-in ranking algorithms provide high-quality search results "out of the box," considering typos, synonyms, faceted search, and more.
- Typo Tolerance: Automatic typo handling allows users to find what they're looking for, even with errors in their query.
- Flexibility: Support for filtering, sorting, faceted search, and customizable ranking.
- Ease of Use: A lightweight API and intuitive admin panel simplify integration and management.
- Open Source: Full transparency and the ability for the community to contribute.
- Low Resource Consumption: Thanks to Rust, Meilisearch efficiently uses CPU and RAM resources, which is critical for `meilisearch vps` deployments.
Typical Use Cases
Meilisearch can be integrated into a wide variety of applications and projects where fast and accurate search is required:- Online Stores and Product Catalogs: Providing instant search across thousands or millions of products with filtering by categories, prices, brands.
- Blogs and News Portals: Improving content navigation, allowing users to quickly find articles by keywords.
- Documentation and Help Systems: Creating efficient search systems for technical documents, FAQs, or knowledge bases.
- Web Applications and SaaS Services: Implementing search functionality for user data, records, or objects in various applications.
- Forums and Communities: Helping users find relevant topics and posts. For example, for platforms like OpenProject on VPS or Flarum, Meilisearch can be a powerful addition to existing search functionality.
Meilisearch System Requirements: Which VPS to Choose?
Choosing the right VPS configuration for Meilisearch is crucial for ensuring optimal performance and stability. While Meilisearch is known for its efficiency, the volume of data, query intensity, and indexing complexity directly impact resource requirements. For a successful `установка meilisearch` (Meilisearch installation) on a server, several key factors must be considered.Minimum and Recommended Configurations
Minimum VPS requirements for Meilisearch are quite modest, but real projects with growing loads will require more powerful configurations.- Minimum Configuration (for development and small projects):
- CPU: 1 vCPU (2.0 GHz+)
- RAM: 1 GB
- Disk: 10-20 GB NVMe SSD (for I/O speed)
- OS: Ubuntu 20.04+, Debian 11+, CentOS 8+
- Bandwidth: 100 Mbps
- Recommended Configuration (for medium projects with moderate load):
- CPU: 2 vCPU (2.5 GHz+)
- RAM: 4-8 GB
- Disk: 50-100 GB NVMe SSD (for fast index access)
- OS: Ubuntu 22.04 LTS
- Bandwidth: 500 Mbps - 1 Gbps
Impact of Data Volume and Load on Performance
Meilisearch performance on your VPS depends on several factors:- Volume of Indexed Data: The more documents and fields you index, the more RAM and disk space will be required. Meilisearch indexes are stored on disk but are actively cached in RAM for fast access.
- Number and Complexity of Queries: Frequent or complex search queries (with many filters, facets) will consume more CPU and RAM.
- Index Update Frequency: If you frequently add, update, or delete documents, this will create additional load on the CPU and disk during indexing operations.
- Disk Type: NVMe SSD significantly outperforms SATA SSD and HDD in I/O operations, which is critically important for Meilisearch. A slow disk will be the main bottleneck.
- Presence of Other Services on the VPS: If other applications (web server, database, other microservices) are running on your VPS, they will compete for resources. It is recommended to allocate a separate VPS for Meilisearch or carefully plan resource distribution.
Looking for a reliable server for your projects?
VPS from $10/month and dedicated servers from $9/month with NVMe, DDoS protection, and 24/7 support.
View offers →Step-by-Step Meilisearch Installation on VPS with Docker Compose
The most recommended and convenient way to deploy Meilisearch, especially for `meilisearch self-hosted` solutions, is to use Docker and Docker Compose. This approach ensures isolation, ease of management, and portability. We will show you how to perform `установка meilisearch` (Meilisearch installation) on your server.Preparing the VPS for Deployment
Before proceeding with the `meilisearch docker` installation, you need to prepare your VPS. It is assumed that you have a fresh VPS with Ubuntu 22.04 LTS and sudo privileges. 1. Update the system: Update your operating system packages to the latest versions.sudo apt update && sudo apt upgrade -y
2. Install Docker:
If Docker is not yet installed, run the following commands:
sudo apt install ca-certificates curl gnupg lsb-release -y
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io docker-compose-plugin -y
Add the current user to the `docker` group to run Docker commands without `sudo`:
sudo usermod -aG docker $USER
newgrp docker
Check the `установка meilisearch` (Meilisearch Docker) installation by running a test container:
docker run hello-world
3. Install Docker Compose (if not installed as a plugin):
In modern Docker versions, `docker-compose` is often shipped as a `docker compose` plugin. If you have an older version or prefer a separate binary, install it as follows:
sudo curl -L "https://github.com/docker/compose/releases/download/v2.24.5/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
Check the Docker Compose version:
docker-compose --version
or
docker compose version
For more detailed information on installing Docker and Docker Compose, you can refer to our guides, for example, Coder on VPS: Installation, Configuration, and Maintenance, which also covers the basics of working with Docker.
Deploying Meilisearch with Docker Compose
Now that Docker and Docker Compose are ready, you can deploy Meilisearch. 1. Create a directory for Meilisearch: Create a directory where Meilisearch configuration files and data will be stored.mkdir ~/meilisearch
cd ~/meilisearch
2. Create the `docker-compose.yml` file:
Create a `docker-compose.yml` file with the following content. This file defines the Meilisearch service, its image, ports, data volumes, and an environment variable for the API key.
version: '3.8'
services:
meilisearch:
image: getmeili/meilisearch:latest
container_name: meilisearch
ports:
- "7700:7700"
volumes:
- ./data.ms:/data.ms # Directory for Meilisearch data storage
environment:
- MEILI_MASTER_KEY=YOUR_SECURE_MASTER_KEY # Replace with a strong key
- MEILI_NO_ANALYTICS=true # Disable sending anonymous data
restart: always
* `MEILI_MASTER_KEY`: **You must replace `YOUR_SECURE_MASTER_KEY` with a complex and unique key.** This key is used to access the Meilisearch API and protect your data. Write it down in a safe place.
* `./data.ms`: This is a volume that mounts the `data.ms` directory from the current host directory into the container. All Meilisearch indexes and data will be stored here.
* `ports: - "7700:7700"`: Meilisearch listens on port 7700 by default. We expose it externally to allow access to the service.
* `restart: always`: Ensures that Meilisearch will automatically start when the VPS starts or in case of failure.
3. Start Meilisearch:
Start Meilisearch using Docker Compose in the background:
docker compose up -d
or, if you have an older version of Docker Compose:
docker-compose up -d
4. Check status:
Make sure the container is running:
docker compose ps
You should see `Up` status for the `meilisearch` container.
You can also check Meilisearch's availability by making a request to its API (replace `YOUR_VPS_IP` with your VPS's IP address):
curl "http://YOUR_VPS_IP:7700/health"
In response, you should receive:
{"status":"available"}
Meilisearch is now successfully installed and running on your VPS. The next step will be to configure a Reverse Proxy for secure access via HTTPS.
rocket_launch
Quick pick
Need a dedicated server?
Compare prices from top providers. Configure and order in minutes.
Configuring Reverse Proxy and HTTPS for Meilisearch on the Server
Direct access to Meilisearch via port 7700 (HTTP) is not recommended for production environments due to the lack of encryption and a convenient domain name. Instead, we will configure `meilisearch на сервере` (Meilisearch on the server) using a reverse proxy (Nginx or Caddy) and HTTPS to ensure a secure and accessible connection. This also makes your `meilisearch self-hosted` solution more professional.Nginx Configuration as a Reverse Proxy
Nginx is a popular and high-performance web server that is excellent for the role of a reverse proxy. 1. Install Nginx: If Nginx is not yet installed on your VPS:sudo apt install nginx -y
sudo systemctl enable nginx
sudo systemctl start nginx
2. DNS Configuration:
Ensure you have a domain name (e.g., `search.yourdomain.com`) pointing to your VPS's IP address. Add the corresponding A record in your DNS provider's settings.
3. Create Nginx configuration file:
Create a new configuration file for your domain (e.g., `meilisearch.conf`) in the `/etc/nginx/sites-available/` directory:
sudo nano /etc/nginx/sites-available/meilisearch.conf
Paste the following content, replacing `search.yourdomain.com` with your domain:
server {
listen 80;
listen [::]:80;
server_name search.yourdomain.com;
location / {
proxy_pass http://127.0.0.1:7700;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
4. Activate configuration:
Create a symbolic link to the configuration file in the `sites-enabled` directory and check Nginx syntax:
sudo ln -s /etc/nginx/sites-available/meilisearch.conf /etc/nginx/sites-enabled/
sudo nginx -t
If the syntax is correct, reload Nginx:
sudo systemctl reload nginx
Meilisearch should now be accessible via HTTP through your domain.
Caddy Configuration as a Reverse Proxy
Caddy is a modern web server that automatically obtains and renews SSL certificates with Let's Encrypt, which greatly simplifies HTTPS setup. 1. Install Caddy: Install Caddy by following the instructions on the official website or using the following commands for Debian/Ubuntu:sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
sudo apt update
sudo apt install caddy -y
2. DNS Configuration:
As with Nginx, ensure your domain (e.g., `search.yourdomain.com`) points to your VPS's IP address.
3. Create Caddyfile:
Edit or create the default `Caddyfile`:
sudo nano /etc/caddy/Caddyfile
Remove existing content and paste the following, replacing `search.yourdomain.com` with your domain:
search.yourdomain.com {
reverse_proxy 127.0.0.1:7700
}
Caddy will automatically detect that HTTPS is required and obtain a certificate.
4. Apply Caddy configuration:
sudo systemctl reload caddy
Meilisearch should now be accessible via your domain over HTTPS.
Obtaining SSL Certificates with Let's Encrypt (for Nginx)
For Nginx, an additional step is required to obtain SSL certificates. Caddy does this automatically. 1. Install Certbot:sudo apt install certbot python3-certbot-nginx -y
2. Obtain and install certificate:
Run Certbot and follow the instructions. It will automatically detect your domain from the Nginx configuration and set up HTTPS.
sudo certbot --nginx -d search.yourdomain.com
Certbot will ask if you want to redirect HTTP traffic to HTTPS. It is recommended to choose redirection.
Check that Nginx has successfully reloaded.
3. Check automatic renewal:
Certbot automatically sets up a cron job to renew certificates. You can check its operation:
sudo certbot renew --dry-run
If everything is in order, you will see a message about successful renewal simulation.
Now your `meilisearch на сервере` (Meilisearch on the server) is accessible via HTTPS through a domain name, providing a secure connection for all interactions with the search engine. Many of our deployment guides, such as Woodpecker CI on VPS: Installation, Configuration, and Maintenance, also include detailed instructions on configuring Nginx and HTTPS, confirming the importance of this step for any web service.
Initial Setup and Data Indexing in Meilisearch
After successful `установка meilisearch` (Meilisearch installation) and reverse proxy configuration, it's time to start working with the search engine itself. This includes accessing the admin panel, managing API keys, and most importantly, indexing your data.Accessing Meilisearch and API Keys
Meilisearch provides a simple web interface for monitoring and management, as well as a powerful API for interacting with your applications. 1. Accessing the Admin Panel: Open your browser and navigate to your domain (e.g., `https://search.yourdomain.com`). You will see the Meilisearch welcome page. To access the web interface, you will need the master key (MEILI_MASTER_KEY) that you specified in the `docker-compose.yml` file. Enter it in the corresponding field. 2. Managing API Keys: In the Meilisearch web interface, go to "Settings" -> "API Keys". Here you can create various API keys with different access levels:- `default` (admin) key: Has full access to all operations (creating indexes, adding documents, configuration). Use it only for administrative tasks.
- `search` key: Only for search operations. This key is safe to use on the client side of your application.
- `private` key: Has full access, including write and delete operations. Use it on the server side of your application.
Adding and Updating Documents
Meilisearch works with the concept of indexes. An index is a collection of documents that you want to make searchable. Each document is a JSON object. 1. Creating an Index: An index is created automatically when the first document is added or explicitly via the API. Example of creating an index named `products` using `curl`:curl -X POST 'https://search.yourdomain.com/indexes' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_PRIVATE_API_KEY' \
--data-binary '{
"uid": "products",
"primaryKey": "id"
}'
Replace `YOUR_PRIVATE_API_KEY` with your private API key. `primaryKey` is a unique identifier for each document.
2. Adding Documents:
You can add documents one by one or in batches.
Example of adding a single document:
curl -X POST 'https://search.yourdomain.com/indexes/products/documents' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_PRIVATE_API_KEY' \
--data-binary '{
"id": "1",
"name": "Smartphone XYZ",
"description": "Powerful smartphone with a 6.5-inch screen and a triple camera.",
"category": "Electronics",
"price": 799.99
}'
Example of adding multiple documents:
curl -X POST 'https://search.yourdomain.com/indexes/products/documents' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_PRIVATE_API_KEY' \
--data-binary '[
{
"id": "2",
"name": "Laptop ABC",
"description": "Lightweight and powerful laptop for work and study.",
"category": "Computers",
"price": 1200.00
},
{
"id": "3",
"name": "Wireless Headphones",
"description": "Noise-canceling headphones with long battery life.",
"category": "Accessories",
"price": 149.99
}
]'
Meilisearch automatically indexes added documents.
3. Updating Documents:
To update a document, send it again with the same `primaryKey`. Meilisearch will only update the changed fields.
curl -X PUT 'https://search.yourdomain.com/indexes/products/documents' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_PRIVATE_API_KEY' \
--data-binary '{
"id": "1",
"price": 749.99,
"stock": 150
}'
4. Index Configuration (ranking, filters, facets):
Meilisearch allows fine-tuning of index behavior. For example, you can define which fields should be available for filtering or faceted search, and configure the ranking order.
Example of configuring fields for faceted search:
curl -X PATCH 'https://search.yourdomain.com/indexes/products/settings' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_PRIVATE_API_KEY' \
--data-binary '{
"filterableAttributes": ["category", "price"],
"sortableAttributes": ["price", "name"]
}'
After indexing and configuration, you can start performing search queries via the Meilisearch API from your application.
Meilisearch Maintenance: Backups, Updates, and Monitoring
Regular maintenance is a key aspect of successful `meilisearch vps` operation. This includes creating data backups, timely engine updates, and continuous monitoring of its performance and status.Meilisearch Data Backup Strategies
Meilisearch data (indexes, settings) is stored in the directory you mounted to the container (in our case, `./data.ms`). Regular backup of this directory is critically important to prevent data loss. 1. Stop Meilisearch (recommended for consistent backups): To create the most consistent backup, it is recommended to temporarily stop Meilisearch.cd ~/meilisearch
docker compose stop meilisearch
2. Create a data archive:
Archive the `data.ms` directory.
tar -czvf meilisearch_backup_$(date +%Y%m%d%H%M%S).tar.gz data.ms
This will create a `meilisearch_backup_YYYYMMDDHHMMSS.tar.gz` file in your current directory.
3. Start Meilisearch:
docker compose start meilisearch
4. Automate Backups:
You can automate this process by creating a script and configuring it to run via `cron`.
Example `backup_meilisearch.sh` script:
#!/bin/bash
BACKUP_DIR="/var/backups/meilisearch"
MEILI_DATA_DIR="/home/$USER/meilisearch/data.ms" # Make sure the path is correct
COMPOSE_DIR="/home/$USER/meilisearch"
mkdir -p $BACKUP_DIR
echo "Stopping Meilisearch..."
docker compose -f $COMPOSE_DIR/docker-compose.yml stop meilisearch
echo "Creating backup..."
tar -czvf $BACKUP_DIR/meilisearch_backup_$(date +%Y%m%d%H%M%S).tar.gz $MEILI_DATA_DIR
echo "Starting Meilisearch..."
docker compose -f $COMPOSE_DIR/docker-compose.yml start meilisearch
echo "Cleaning old backups (keeping last 7)..."
find $BACKUP_DIR -name "meilisearch_backup_*.tar.gz" -mtime +7 -delete
echo "Backup complete."
Make the script executable:
chmod +x backup_meilisearch.sh
Add it to `crontab` for daily execution (e.g., at 3:00 AM):
crontab -e
Add the line:
0 3 * * * /path/to/your/backup_meilisearch.sh > /dev/null 2>&1
Important: Store backups on a separate disk or in remote storage, different from your VPS, to protect against data loss in case of server failure.
Meilisearch Docker Container Update Process
Updating Meilisearch via Docker Compose is a simple process. Regular updates are important for new features, performance improvements, and security fixes. 1. Navigate to the Meilisearch directory:cd ~/meilisearch
2. Stop and remove the current container:
This will stop and remove the old container, but your data will be preserved as it is stored in the mounted volume.
docker compose down
3. Pull the latest image version:
docker compose pull meilisearch
This will download the freshest `getmeili/meilisearch:latest` image.
4. Start Meilisearch with the new image:
docker compose up -d
Docker Compose will create a new container with the updated image, using your existing data.
5. Check version:
Ensure Meilisearch has updated by checking its version via the API:
curl "https://search.yourdomain.com/version"
Or via Docker:
docker compose exec meilisearch meilisearch --version
This process allows you to easily keep your `meilisearch docker` up to date. For other self-hosted applications, such as Redmine on VPS: Installation, Configuration, and Maintenance, regular updates and backups are also extremely important, but their process may differ.
Performance and Resource Monitoring
Monitoring your Meilisearch on a VPS allows you to quickly identify problems and optimize resources.- VPS Resource Usage:
- `htop` or `top`: For a quick overview of CPU, RAM, and process load.
- `docker stats`: For monitoring resource usage of a specific Meilisearch Docker container.
- `iostat` or `iotop`: For monitoring disk I/O operations, which is critical for Meilisearch.
You will see CPU, RAM consumption, disk I/O, and network traffic for the Meilisearch container.docker stats meilisearch - Meilisearch Logs:
Check the Meilisearch container logs for errors or warnings:
To view logs in real-time:docker compose logs meilisearchdocker compose logs -f meilisearch - Meilisearch API:
Meilisearch provides an API for checking status and metrics:
- `GET /health`: Checks Meilisearch availability.
- `GET /stats`: Provides statistics on indexes, document count, database size.
- `GET /tasks`: Shows the status of current and completed tasks (indexing, updating).
rocket_launch
Quick pick
Need a dedicated server?
Compare prices from top providers. Configure and order in minutes.
Which Meilisearch VPS Configuration for Real Load?
Choosing the optimal VPS configuration for Meilisearch under real load is a balance between cost and performance. `meilisearch vps` can be very flexible, but it's important to correctly assess project needs.Assessing Needs for Various Projects
To determine which VPS you need, answer the following questions: 1. Data Volume: How many documents do you plan to index? (Thousands, hundreds of thousands, millions, tens of millions?) * Each document takes up disk space and RAM. Indexes can be significantly larger than the original data. 2. Document Size: How large are your documents on average? (Few fields, many text fields?) 3. Query Intensity: How many queries per second (QPS) are expected? (Units, tens, hundreds, thousands?) 4. Update Frequency: How often will you add/update/delete documents? (Once a day, once an hour, every minute?) Frequent updates require more CPU and I/O resources. 5. Query Complexity: Will queries be simple (single word) or complex (many filters, facets, sorting)? Complex queries require more CPU. 6. Budget: What is your monthly budget for hosting?Example VPS Configurations from Valebyte.com
Based on these factors, we can offer the following recommendations for `meilisearch на сервере` (Meilisearch on the server) VPS configurations:| Scenario | Number of Documents | Expected Load | CPU (vCPU) | RAM (GB) | Disk (NVMe SSD) | Approximate Cost/Month |
|---|---|---|---|---|---|---|
| Development / Testing / Very Small Project | Up to 50,000 | Few QPS | 1 | 1-2 | 20 GB | From $5 - $10 |
| Small Project / Blog / Small Online Store | 50,000 - 500,000 | 5-20 QPS, infrequent updates | 2 | 4 | 50 GB | From $15 - $25 |
| Medium Project / Catalog / CRM | 500,000 - 5,000,000 | 20-100 QPS, moderate updates | 4 | 8-16 | 100-200 GB | From $30 - $60 |
| Large Project / High-Traffic E-commerce | 5,000,000 - 20,000,000+ | 100-500+ QPS, frequent updates | 8+ | 32-64+ | 300 GB+ | From $80+ |
Conclusion
`Установка Meilisearch` (Meilisearch installation) on a VPS via Docker Compose is an efficient and scalable way to deploy a powerful search engine for your projects. The correct choice of VPS configuration, especially with NVMe SSD and sufficient RAM, combined with proper reverse proxy setup and regular maintenance, ensures high performance and reliability. Valebyte.com offers flexible VPS solutions ideally suited for hosting `meilisearch vps`, providing the necessary power and control for your search needs.Ready to choose a server?
VPS and dedicated servers in 72+ countries with instant activation and full root access.
Start now →