You click "Create Server" on Deploynix, select your cloud provider, choose your server type, and three minutes later you have a fully configured, security-hardened, production-ready server waiting for your Laravel application. But what happens in those three minutes? What does Deploynix actually do to turn a blank Ubuntu instance into a server that is ready to handle real traffic?
This is a behind-the-curtain look at the provisioning process. Understanding what happens under the hood helps you make better infrastructure decisions, debug issues when they arise, and appreciate why certain conventions exist. It also demystifies the "magic" of server management platforms and shows that provisioning is really just automation of the expert-level system administration that would otherwise take hours of manual work.
Step 0: Server Creation on the Cloud Provider
Before Deploynix touches anything, it needs a server to work with. Through the API of your chosen cloud provider (DigitalOcean, Vultr, Hetzner, Linode, AWS, or a custom provider), Deploynix requests a new virtual machine with your specified size, region, and operating system.
For custom providers, you supply the server's IP address and root credentials, and Deploynix connects to an existing machine. This path skips the cloud API call but follows the same provisioning steps from that point forward.
The cloud provider spins up the virtual machine, assigns an IP address, and starts the instance. This typically takes 30-60 seconds depending on the provider. Deploynix polls for the server to become available, and as soon as SSH connectivity is confirmed, the provisioning script begins.
Step 1: Initial SSH Connection and Key Exchange
The first thing Deploynix does is establish an SSH connection to the new server. This is a root-level connection used exclusively for the initial provisioning. One of the first actions is to set up a dedicated deploy user with appropriate permissions, replacing root access for all subsequent operations.
Deploynix generates an SSH key pair for the server and installs the public key on the machine. This key is used for all future connections, including deployments, server management, and the web terminal feature. Password authentication is disabled entirely, a critical security step that prevents brute-force attacks against SSH.
The deploy user is added to the appropriate groups for managing web services, but not given unrestricted sudo access. Operations that require elevated privileges go through carefully scoped sudo rules, following the principle of least privilege.
Step 2: System Updates and Base Packages
With SSH access established, Deploynix updates the operating system's package index and installs security updates. This ensures the server starts with the latest patches, not the potentially outdated packages baked into the cloud provider's base image.
Then the base packages are installed. These are the foundation that every server type needs regardless of its specific role:
- curl, wget, and git: For downloading packages and managing code
- unzip and zip: For handling compressed archives, including Composer packages
- software-properties-common: For managing additional package repositories
- supervisor: For managing long-running processes like queue workers and daemons
- ufw (Uncomplicated Firewall): For firewall management
This step runs the system's package manager with non-interactive flags to ensure no installation prompts block the automation. Package installation typically takes 30-60 seconds depending on the server's network speed and the provider's mirror proximity.
Step 3: PHP Installation and Configuration
For App, Web, and Worker server types, PHP is the next installation target. Deploynix adds the trusted PHP package repository and installs the PHP version you selected along with the extensions your Laravel application needs.
The standard extension set includes:
- php-fpm: The FastCGI process manager that serves PHP applications through Nginx
- php-cli: For running artisan commands, queue workers, and scheduled tasks
- php-mysql, php-pgsql: Database drivers (installed based on your database choice)
- php-mbstring: Multibyte string support
- php-xml: XML parsing
- php-curl: HTTP client support
- php-zip: Archive handling
- php-gd and php-imagick: Image processing
- php-redis: For connecting to Valkey cache servers
- php-bcmath: Arbitrary precision mathematics
- php-intl: Internationalization support
- php-opcache: Bytecode caching for production performance
After installation, Deploynix writes optimized PHP configuration. The php.ini settings are tuned for production: display_errors is off, memory_limit is set appropriately for the server size, upload_max_filesize and post_max_size are configured for reasonable file uploads, and max_execution_time is set to prevent runaway scripts.
PHP-FPM pool configuration is particularly important. Deploynix calculates the optimal pm.max_children based on the server's available memory, sets pm to dynamic or static based on the server type, and configures process lifecycle settings. This calculation prevents the common mistake of setting too many worker processes and running out of memory, or too few and leaving capacity unused.
OPcache is enabled with production-appropriate settings: opcache.enable=1, opcache.memory_consumption scaled to the server size, opcache.max_accelerated_files=20000, and opcache.validate_timestamps=0 for maximum performance.
Step 4: Nginx Installation and Configuration
Nginx is installed from the official repository to ensure the latest stable version. Deploynix writes a base Nginx configuration that includes:
- Worker processes set to the number of CPU cores
- Worker connections set high enough for production traffic
- Gzip compression enabled for text-based content types
- Security headers including
X-Frame-Options,X-Content-Type-Options, andX-XSS-Protection - Server tokens disabled to hide Nginx version information
- Client body size configured for file uploads
- SSL settings with modern cipher suites and protocols
At this point, no sites are configured yet. The base Nginx installation listens on port 80 and returns a default page. Site-specific configurations are created later when you add sites to the server.
Step 5: Database Installation (Database Servers)
For Database server types, this is where the heavy lifting happens. Based on your selection, Deploynix installs MySQL, MariaDB, or PostgreSQL from the official repositories.
MySQL/MariaDB configuration includes setting the root password, creating the application database, configuring innodb_buffer_pool_size based on available memory (typically 50-70% of total RAM), setting the character set to utf8mb4, and enabling the slow query log for performance monitoring.
PostgreSQL configuration includes creating the application database and user, configuring shared_buffers (typically 25% of RAM), setting effective_cache_size (typically 75% of RAM), and enabling query logging.
Deploynix also configures the database to accept connections from your application servers' IP addresses, not from the public internet. This is a critical security measure: your database port is only accessible from servers you control.
Step 6: Cache Installation (Cache Servers)
For Cache server types, Deploynix installs Valkey, the Redis-compatible in-memory data store. Configuration includes:
- maxmemory set based on the server's available RAM
- maxmemory-policy set to
allkeys-lrufor cache use cases (least recently used eviction) - bind configured to accept connections only from your application servers
- requirepass set with a strong generated password
- appendonly configured based on whether persistence is needed
Valkey serves double duty in most Deploynix setups: it handles both application caching and queue backend (when using the Redis queue driver). The configuration is optimized for this dual role.
Step 7: Security Hardening
Security is not an afterthought bolted on at the end. Many security measures are woven into earlier steps (SSH key-only auth, database network restrictions, disabled server tokens). But this step applies additional hardening:
Firewall configuration using UFW. Only essential ports are opened: 22 (SSH), 80 (HTTP), and 443 (HTTPS). All other inbound traffic is blocked by default. Deploynix's firewall rule management lets you open additional ports as needed, but the default posture is deny-all.
Fail2ban installation monitors SSH authentication logs and automatically bans IP addresses that make too many failed login attempts. This provides defense-in-depth beyond key-only SSH authentication.
Unattended security updates are configured so the server automatically installs security patches from the operating system vendor. This ensures critical vulnerabilities are patched even between manual maintenance windows.
SSH hardening beyond key-only authentication includes disabling root login via SSH, configuring connection timeouts, and limiting authentication attempts.
Step 8: Monitoring Agent Setup
Deploynix installs a lightweight monitoring agent that collects server metrics and reports them back to the Deploynix dashboard. This agent monitors:
- CPU utilization across all cores
- Memory usage including available, used, cached, and swap
- Disk usage and I/O throughput
- Network traffic inbound and outbound
- Service status for Nginx, PHP-FPM, database, and cache services
The monitoring agent runs as a system service managed by supervisor, ensuring it restarts automatically if it crashes. It communicates with Deploynix's backend over HTTPS, so no additional firewall ports need to be opened.
This monitoring data powers Deploynix's real-time server dashboard and health alert system. When CPU exceeds your configured threshold, when disk usage approaches capacity, or when a service stops responding, Deploynix can alert you before users are affected.
Step 9: SSL and Vanity Domain Setup
Deploynix configures the server to support SSL certificate provisioning. The Let's Encrypt client is installed and configured to work with Deploynix's automated certificate management.
For servers that support vanity domains, the *.deploynix.cloud wildcard certificate is synced from the Deploynix database. This certificate, issued and managed on the Deploynix application server, is stored encrypted in the database and deployed to managed servers during provisioning. This gives your sites immediate HTTPS support through vanity domains without any DNS configuration.
Step 10: Final Verification and Health Check
The last step is verification. Deploynix runs a series of checks to confirm that everything installed correctly:
- Can Nginx start and serve a response on port 80?
- Can PHP-FPM start and process a PHP request?
- Can the database accept connections with the configured credentials?
- Can the cache server accept connections?
- Is the monitoring agent reporting metrics?
- Is the firewall active with the correct rules?
- Are all system services enabled to start on boot?
If any check fails, Deploynix reports the failure with diagnostic information. If all checks pass, the server's status changes to "Active" in the Deploynix dashboard, and it is ready to receive sites and deployments.
What Makes This Fast
Three minutes is fast for all of this work. Several design decisions make it possible:
Parallel installation where possible. Package installations that do not depend on each other run concurrently.
Pre-compiled packages from official repositories. Deploynix does not compile anything from source. Every package comes from a trusted, pre-built repository.
Minimal configuration that is purpose-built. Deploynix does not install a generic server configuration and then customize it. Every configuration file is generated specifically for the server's type, size, and role.
No interactive prompts. Every installation command runs with non-interactive flags and pre-seeded answers. There is no human waiting at a terminal answering questions.
After Provisioning
With the server provisioned, you add sites, configure deployment hooks, set up cron jobs and daemons, and push your first deployment. Each of these operations builds on the foundation that the provisioning process established.
The server is not static after provisioning. Deploynix can update PHP versions, adjust Nginx configurations, modify firewall rules, and manage SSL certificates throughout the server's lifetime. But the initial provisioning sets the foundation: a secure, optimized, monitored server ready for your Laravel application.
Conclusion
The three minutes between clicking "Create Server" and having a production-ready machine represent years of accumulated system administration knowledge, automated and executed reliably every time. Each step, from SSH key exchange to health check verification, exists because skipping it has caused real problems for real applications.
Understanding this process helps you appreciate what your infrastructure platform does, debug issues when they arise, and make informed decisions about your server configuration. The automation is not magic. It is expertise encoded in scripts, executed consistently, and verified systematically.
Top comments (0)