typesense is a free and open-source search engine. Typesense provides fast search engine with built-in typo tolerance
1. Prerequisites
2. Supported Operating Systems
This guide supports installation on:
3. Installation
RHEL/CentOS/Rocky Linux/AlmaLinux
# Install EPEL repository if needed
sudo dnf install -y epel-release
# Install typesense
sudo dnf install -y typesense
# Enable and start service
sudo systemctl enable --now typesense
# Configure firewall
sudo firewall-cmd --permanent --add-port=8108/tcp
sudo firewall-cmd --reload
# Verify installation
typesense --version
Debian/Ubuntu
# Update package index
sudo apt update
# Install typesense
sudo apt install -y typesense
# Enable and start service
sudo systemctl enable --now typesense
# Configure firewall
sudo ufw allow 8108
# Verify installation
typesense --version
Arch Linux
# Install typesense
sudo pacman -S typesense
# Enable and start service
sudo systemctl enable --now typesense
# Verify installation
typesense --version
Alpine Linux
# Install typesense
apk add --no-cache typesense
# Enable and start service
rc-update add typesense default
rc-service typesense start
# Verify installation
typesense --version
openSUSE/SLES
# Install typesense
sudo zypper install -y typesense
# Enable and start service
sudo systemctl enable --now typesense
# Configure firewall
sudo firewall-cmd --permanent --add-port=8108/tcp
sudo firewall-cmd --reload
# Verify installation
typesense --version
macOS
# Using Homebrew
brew install typesense
# Start service
brew services start typesense
# Verify installation
typesense --version
FreeBSD
# Using pkg
pkg install typesense
# Enable in rc.conf
echo 'typesense_enable="YES"' >> /etc/rc.conf
# Start service
service typesense start
# Verify installation
typesense --version
Windows
# Using Chocolatey
choco install typesense
# Or using Scoop
scoop install typesense
# Verify installation
typesense --version
Initial Configuration
Basic Configuration
# Create configuration directory
sudo mkdir -p /etc/typesense
# Set up basic configuration
# See official documentation for detailed configuration options
# Test configuration
typesense --version
5. Service Management
systemd (RHEL, Debian, Ubuntu, Arch, openSUSE)
# Enable service
sudo systemctl enable typesense
# Start service
sudo systemctl start typesense
# Stop service
sudo systemctl stop typesense
# Restart service
sudo systemctl restart typesense
# Check status
sudo systemctl status typesense
# View logs
sudo journalctl -u typesense -f
OpenRC (Alpine Linux)
# Enable service
rc-update add typesense default
# Start service
rc-service typesense start
# Stop service
rc-service typesense stop
# Restart service
rc-service typesense restart
# Check status
rc-service typesense status
rc.d (FreeBSD)
# Enable in /etc/rc.conf
echo 'typesense_enable="YES"' >> /etc/rc.conf
# Start service
service typesense start
# Stop service
service typesense stop
# Restart service
service typesense restart
# Check status
service typesense status
launchd (macOS)
# Using Homebrew services
brew services start typesense
brew services stop typesense
brew services restart typesense
# Check status
brew services list | grep typesense
Windows Service Manager
# Start service
net start typesense
# Stop service
net stop typesense
# Using PowerShell
Start-Service typesense
Stop-Service typesense
Restart-Service typesense
# Check status
Get-Service typesense
Advanced Configuration
See the official documentation for advanced configuration options.
Reverse Proxy Setup
nginx Configuration
upstream typesense_backend {
server 127.0.0.1:8108;
}
server {
listen 80;
server_name typesense.example.com;
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl http2;
server_name typesense.example.com;
ssl_certificate /etc/ssl/certs/typesense.example.com.crt;
ssl_certificate_key /etc/ssl/private/typesense.example.com.key;
location / {
proxy_pass http://typesense_backend;
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;
}
}
Apache Configuration
<VirtualHost *:80>
ServerName typesense.example.com
Redirect permanent / https://typesense.example.com/
</VirtualHost>
<VirtualHost *:443>
ServerName typesense.example.com
SSLEngine on
SSLCertificateFile /etc/ssl/certs/typesense.example.com.crt
SSLCertificateKeyFile /etc/ssl/private/typesense.example.com.key
ProxyRequests Off
ProxyPreserveHost On
ProxyPass / http://127.0.0.1:8108/
ProxyPassReverse / http://127.0.0.1:8108/
</VirtualHost>
HAProxy Configuration
frontend typesense_frontend
bind *:80
bind *:443 ssl crt /etc/ssl/certs/typesense.pem
redirect scheme https if !{ ssl_fc }
default_backend typesense_backend
backend typesense_backend
balance roundrobin
server typesense1 127.0.0.1:8108 check
Security Configuration
Basic Security Setup
# Set appropriate permissions
sudo chown -R typesense:typesense /etc/typesense
sudo chmod 750 /etc/typesense
# Configure firewall
sudo firewall-cmd --permanent --add-port=8108/tcp
sudo firewall-cmd --reload
# Enable SELinux policies (if applicable)
sudo setsebool -P httpd_can_network_connect on
Database Setup
See official documentation for database configuration requirements.
Performance Optimization
System Tuning
# Basic system tuning
echo 'net.core.somaxconn = 65535' | sudo tee -a /etc/sysctl.conf
echo 'net.ipv4.tcp_max_syn_backlog = 65535' | sudo tee -a /etc/sysctl.conf
sudo sysctl -p
Monitoring
Basic Monitoring
# Check service status
sudo systemctl status typesense
# View logs
sudo journalctl -u typesense -f
# Monitor resource usage
top -p $(pgrep typesense)
9. Backup and Restore
Backup Script
#!/bin/bash
# Basic backup script
BACKUP_DIR="/backup/typesense"
DATE=$(date +%Y%m%d_%H%M%S)
mkdir -p "$BACKUP_DIR"
tar -czf "$BACKUP_DIR/typesense-backup-$DATE.tar.gz" /etc/typesense /var/lib/typesense
echo "Backup completed: $BACKUP_DIR/typesense-backup-$DATE.tar.gz"
Restore Procedure
# Stop service
sudo systemctl stop typesense
# Restore from backup
tar -xzf /backup/typesense/typesense-backup-*.tar.gz -C /
# Start service
sudo systemctl start typesense
6. Troubleshooting
Common Issues
1. Service won't start:
# Check logs
sudo journalctl -u typesense -n 100
sudo tail -f /var/log/typesense/typesense.log
# Check configuration
typesense --version
# Check permissions
ls -la /etc/typesense
2. Connection issues:
# Check if service is listening
sudo ss -tlnp | grep 8108
# Test connectivity
telnet localhost 8108
# Check firewall
sudo firewall-cmd --list-all
3. Performance issues:
# Check resource usage
top -p $(pgrep typesense)
# Check disk I/O
iotop -p $(pgrep typesense)
# Check connections
ss -an | grep 8108
Integration Examples
Docker Compose Example
version: '3.8'
services:
typesense:
image: typesense:latest
ports:
- "8108:8108"
volumes:
- ./config:/etc/typesense
- ./data:/var/lib/typesense
restart: unless-stopped
Maintenance
Update Procedures
# RHEL/CentOS/Rocky/AlmaLinux
sudo dnf update typesense
# Debian/Ubuntu
sudo apt update && sudo apt upgrade typesense
# Arch Linux
sudo pacman -Syu typesense
# Alpine Linux
apk update && apk upgrade typesense
# openSUSE
sudo zypper update typesense
# FreeBSD
pkg update && pkg upgrade typesense
# Always backup before updates
tar -czf /backup/typesense-pre-update-$(date +%Y%m%d).tar.gz /etc/typesense
# Restart after updates
sudo systemctl restart typesense
Regular Maintenance
# Log rotation
sudo logrotate -f /etc/logrotate.d/typesense
# Clean old logs
find /var/log/typesense -name "*.log" -mtime +30 -delete
# Check disk usage
du -sh /var/lib/typesense
Additional Resources
---
Note: This guide is part of the HowToMgr collection. Always refer to official documentation for the most up-to-date information.