Deploying 1C-Bitrix on Selectel
Selectel is one of Russia's oldest hosting providers with data centers in Saint Petersburg and Moscow. It stands out for its comprehensive documentation, predictable pricing, and genuinely responsive support. For Bitrix projects, Selectel offers virtual servers (VPS/VDS), dedicated servers, cloud servers, and object storage (S3-compatible).
Hosting Options on Selectel
| Option | When It Fits |
|---|---|
| Virtual Server (VPS) | Low to medium traffic, budget projects |
| Cloud Server | Need flexible resources, hourly billing |
| Dedicated Server | High traffic, performance requirements |
| Managed Kubernetes | Microservices architecture, scaling |
For most Bitrix projects, a cloud server with Object Storage for files and a dedicated database (MySQL on a separate server or Managed DB) is recommended.
Creating a Cloud Server
Selectel provides a convenient CLI (slc) and web panel. Through the panel:
- Cloud → Servers → Create Server
- Image: Ubuntu 22.04 LTS
- Configuration: starting from 2 vCPU / 4 GB RAM
- Disk: SSD
local-fast(NVMe) — maximum I/O speed, critical for Bitrix - Network: public IP + private network for database connectivity
Via CLI:
slc cloud server create \
--name bitrix-web \
--flavor sl1.2.20 \
--image ubuntu-22.04-202312 \
--root-password YOUR_STRONG_PASSWORD \
--network public,private
Software Stack: nginx + PHP-FPM
# Update system
apt update && apt upgrade -y
# Nginx
apt install -y nginx
# PHP 8.1 (Bitrix supports up to 8.2)
add-apt-repository ppa:ondrej/php -y
apt install -y php8.1-fpm php8.1-mysql php8.1-curl php8.1-gd \
php8.1-mbstring php8.1-xml php8.1-zip php8.1-bcmath \
php8.1-intl php8.1-soap php8.1-redis php8.1-opcache php8.1-imagick
Nginx configuration for Bitrix — use the official bitrix-nginx.conf from 1C or write manually:
server {
listen 443 ssl http2;
server_name example.ru;
root /var/www/bitrix/public_html;
ssl_certificate /etc/letsencrypt/live/example.ru/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/example.ru/privkey.pem;
ssl_protocols TLSv1.2 TLSv1.3;
client_max_body_size 100m;
client_body_timeout 120s;
# Static files — direct serving
location ~* \.(css|js|png|jpg|gif|ico|svg|woff2)$ {
expires 30d;
add_header Cache-Control "public, immutable";
}
# Restricted Bitrix folders
location ~ /\.ht { deny all; }
location ~ /bitrix/modules/ { deny all; }
location ~ /bitrix/php_interface/ { deny all; }
location ~ /bitrix/tools/ { deny all; }
location ~ \.php$ {
fastcgi_pass unix:/run/php/php8.1-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_read_timeout 120;
include fastcgi_params;
}
}
Database: MySQL on a Separate Server
Selectel doesn't provide Managed MySQL like Yandex Cloud — only virtual and dedicated servers. So there are two options:
A. MySQL on a separate cloud server:
# On the database server
apt install -y mysql-server-8.0
mysql_secure_installation
# Create database and user
mysql -e "CREATE DATABASE bitrix CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"
mysql -e "CREATE USER 'bitrix'@'10.0.1.%' IDENTIFIED BY 'PASSWORD';"
mysql -e "GRANT ALL ON bitrix.* TO 'bitrix'@'10.0.1.%';"
B. Managed DB through Selectel (available via partner services).
Important MySQL parameters for Bitrix (/etc/mysql/mysql.conf.d/mysqld.cnf):
[mysqld]
innodb_buffer_pool_size = 2G
innodb_log_file_size = 512M
innodb_flush_log_at_trx_commit = 2
query_cache_type = 0
max_connections = 300
slow_query_log = 1
slow_query_log_file = /var/log/mysql/slow.log
long_query_time = 2
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
Object Storage for Files
Selectel Object Storage is S3-compatible, endpoint is s3.storage.selcloud.ru.
# Install s3cmd
apt install -y s3cmd
# Configure
s3cmd --configure
# host_base = s3.storage.selcloud.ru
# host_bucket = %(bucket)s.s3.storage.selcloud.ru
# Create bucket
s3cmd mb s3://bitrix-files
For mounting /upload/ via s3fs — similar to other clouds, specifying Selectel's endpoint.
Alternatively, use rsync to sync /upload/ between multiple servers if object storage is excessive for your project.
Redis for Caching and Sessions
# Redis on the same server (small project) or separate
apt install -y redis-server
# /etc/redis/redis.conf — for internal use
bind 10.0.1.5 # Private IP of application server
requirepass YOUR_REDIS_PASSWORD
maxmemory 1gb
maxmemory-policy allkeys-lru
SSL Certificate via Certbot
apt install -y certbot python3-certbot-nginx
certbot --nginx -d example.ru -d www.example.ru
# Auto renewal
echo "0 3 * * * root certbot renew --quiet" > /etc/cron.d/certbot
Selectel Firewall
In Selectel security groups (firewall) are configured in the panel or via API. Minimal rules:
Incoming:
80/tcp — 0.0.0.0/0 (HTTP, redirect to HTTPS)
443/tcp — 0.0.0.0/0 (HTTPS)
22/tcp — YOUR_OFFICE_IP/32
Between servers (private network):
3306/tcp — only from web server
6379/tcp — only from web server
Monitoring and Backups
Backups on Selectel:
- Disk snapshots — via panel or API, on schedule (needs script setup)
- Database backups via
mysqldumpin cron + upload to Object Storage
#!/bin/bash
# /etc/cron.daily/bitrix-backup
BACKUP_DIR="/tmp/db_backup"
DATE=$(date +%Y%m%d_%H%M)
mkdir -p $BACKUP_DIR
mysqldump -h 10.0.1.10 -u bitrix -pPASSWORD bitrix | gzip > "$BACKUP_DIR/db_$DATE.sql.gz"
s3cmd put "$BACKUP_DIR/db_$DATE.sql.gz" s3://bitrix-backups/db/
find $BACKUP_DIR -mtime +1 -delete
Deployment Timelines
| Option | Composition | Timeline |
|---|---|---|
| Single Server | nginx + PHP + MySQL on one VM | 1 day |
| Separated Infrastructure | Web + separate DB + Redis | 2–3 days |
| With Object Storage and Monitoring | + S3, SSL, backups, firewall | 3–5 days |







