Requirements
MadelineProto has specific system and PHP requirements to ensure optimal performance and compatibility.PHP Version
64-bit Required
MadelineProto requires a 64-bit version of PHP. Check your PHP version and architecture:If you see “32 bit PHP”, you must install the 64-bit version. MadelineProto will not function correctly on 32-bit PHP.
Required PHP Extensions
The following PHP extensions are required for MadelineProto to function:Verify Installed Extensions
Check which extensions are installed:Install Missing Extensions
- Ubuntu/Debian
- CentOS/RHEL
- macOS (Homebrew)
- Windows
Recommended Extensions
These extensions are optional but highly recommended for better performance:gmp
Highly RecommendedSpeeds up authorization and cryptographic operations significantly.
openssl
Highly RecommendedProvides faster cryptographic operations.
uv
Performance BoostGreatly speeds up MadelineProto by providing an efficient event loop.
primemodule + FFI
Maximum PerformanceProvides the fastest possible cryptographic operations.See prime.madelineproto.xyz
Database Extensions (Optional)
For using external databases to reduce RAM usage:- pdo - PDO database abstraction
- pdo_mysql - MySQL support
- pdo_pgsql - PostgreSQL support
- redis - Redis support
Math Extensions (Optional)
Either gmp OR bcmath is recommended:Composer
For installing via Composer (recommended), you need Composer 2.0+:System Requirements
Memory
- Minimum: 128 MB RAM
- Recommended: 256 MB+ RAM
- With Database: Can run with as low as 64 MB when using MySQL/PostgreSQL/Redis
Memory usage depends on your bot’s workload. For bots in many groups, consider using a database backend to reduce RAM usage.
Disk Space
- Minimum: 50 MB free space
- Recommended: 200 MB+ for session files and temporary data
Network
- Stable internet connection
- Ability to connect to Telegram servers (ports 80, 443)
- For MTProxy: Additional port access may be needed
Platform Support
- Linux
- Docker
- macOS
- Windows
Fully Supported
- Ubuntu 20.04+
- Debian 10+
- CentOS 8+
- Alpine Linux
- Any Linux distribution with PHP 8.2+
Conflicting Packages
ext-pthreads- Conflicts with async operationskrakjoe/pthreads-polyfill- Not compatible
Verification Script
Run this script to check if your system meets all requirements:check.php and run:
Next Steps
Once your system meets the requirements:Installation
Install MadelineProto via Composer or PHAR
Quick Start
Build your first bot in minutes
Troubleshooting
32-bit PHP detected
32-bit PHP detected
MadelineProto requires 64-bit PHP. Download and install the 64-bit version:
- Linux: Use your package manager (apt, yum, etc.)
- Windows: Download from windows.php.net (x64 version)
- macOS: Use Homebrew
brew install [email protected]
Extension not found after installation
Extension not found after installation
After installing extensions, restart your web server or PHP-FPM:
GMP/BCMath not available
GMP/BCMath not available
If you can’t install GMP or BCMath, MadelineProto will still work but slower.For best performance, use Docker image which includes all optimizations:
Performance Tip: For maximum performance, install the primemodule extension. See prime.madelineproto.xyz for installation instructions.