RoadRunner
  • 🟠General
    • What is RoadRunner?
    • Features
    • Quick Start
    • Installation
    • Configuration
    • Contributing
    • Upgrade and Compatibility
  • 👷PHP Worker
    • Worker
    • Workers pool
    • Developer mode
    • Code Coverage
    • Debugging
    • Environment
    • Manual workers scaling
    • Auto workers scaling
    • RPC
  • 🟢Customization
    • Building RR with a custom plugin
    • Integrating with Golang Apps
    • Writing a Middleware
    • Writing a Jobs Driver
    • Writing a Plugin
    • Events Bus
  • 🔌Plugins
    • Intro into Plugins
    • Centrifuge (WebSockets)
    • Service (Systemd)
    • Configuration
    • Server
    • Locks
    • gRPC
    • TCP
  • 🌐Community Plugins
    • Intro into Community Plugins
    • Circuit Breaker
    • SendRemoteFile
    • RFC 7234 Cache
  • 🔵App Server
    • Production Usage
    • RoadRunner with NGINX
    • RR as AWS Lambda
    • Docker Images
    • CLI Commands
    • Systemd
  • 🔐Key-Value
    • Intro into KV
    • Memcached
    • In-Memory
    • BoltDB
    • Redis
  • 📦Queues and Jobs
    • Intro into Jobs
    • Google Pub/Sub
    • Beanstalk
    • In-Memory
    • RabbitMQ
    • BoltDB
    • Kafka
    • NATS
    • SQS
  • 🕸️HTTP
    • Intro into HTTP
    • Headers and CORS
    • Proxy IP parser
    • Static files
    • X-Sendfile
    • Streaming
    • gzip
  • 📈Logging and Observability
    • OpenTelemetry
    • HealthChecks
    • Access Logs
    • AppLogger
    • Metrics
    • Grafana
    • Logger
  • 🔀Workflow Engine
    • Temporal.io
    • Worker
  • 🧩Integrations
    • Migration from RRv1 to RRv2
    • Spiral Framework
    • Yii
    • Symfony
    • Laravel
    • ChubbyPHP
  • 🧪Experimental Features
    • List of the Experimental Features
  • 🚨Error codes
    • CRC validation failed
    • Allocate Timeout
  • 📚Releases
    • v2025.1.1
    • v2025.1.0
    • v2024.3.5
    • v2024.3.4
    • v2024.3.3
    • v2024.3.2
    • v2024.3.1
    • v2024.3.0
Powered by GitBook
On this page
  • Step 1: Download RR for your platform
  • Step 2: Install PHP
  • Step 3: Create a simple configuration
  • Step 4: Create a simple worker
  • Step 5: Start the server

Was this helpful?

Edit on GitHub
  1. General

Quick Start

PreviousFeaturesNextInstallation

Last updated 2 months ago

Was this helpful?

This guide will walk you through the steps to get started with RoadRunner. You'll learn how to install RoadRunner and configure it for your project.

Step 1: Download RR for your platform

To begin, you need to download RR for your platform. Visit the and download the appropriate version for your operating system.

Step 2: Install PHP

RR requires PHP to run. If you don't have PHP installed, you can download it from the and follow the installation instructions for your operating system.

Step 3: Create a simple configuration

Next, you need to create a simple configuration file for RR. Open a text editor and create a new file called .rr.yaml. Add the following content to the file:

.rr.yaml
version: "3"

server:
  command: "php psr-worker.php"

http:
  address: 0.0.0.0:8080

# do not use development mode in production
logs:
  level: debug
  mode: development

Step 4: Create a simple worker

Now you need to create a simple worker. Create a new file called psr-worker.php and add the following content to the file:

psr-worker.php
<?php

require __DIR__ . '/vendor/autoload.php';

use Nyholm\Psr7\Response;
use Nyholm\Psr7\Factory\Psr17Factory;

use Spiral\RoadRunner\Worker;
use Spiral\RoadRunner\Http\PSR7Worker;
$worker = Worker::create();

$factory = new Psr17Factory();

$psr7 = new PSR7Worker($worker, $factory, $factory, $factory);

while (true) {
    try {
        $request = $psr7->waitRequest();
        if ($request === null) {
            break;
        }
    } catch (\Throwable $e) {
        $psr7->respond(new Response(400));
        continue;
    }

    try {
        $psr7->respond(new Response(200, [], 'Hello RoadRunner!'));
    } catch (\Throwable $e) {
        $psr7->respond(new Response(500, [], 'Something Went Wrong!'));
        $psr7->getWorker()->error((string)$e);
    }
}

Step 5: Start the server

Now you can start the server. You should have the following files in the current folder:

  • .rr.yaml

  • psr-worker.php

  • rr binary

Then, open a terminal window in the current folder and run the following command:

./rr serve

Since you have the logs in the development mode, you should see the following output:

RoadRunner is not only HTTP plugin. There are a lot of other plugins. You can find more information about plugins in the section.

🟠
RR installation guide
official PHP website
Plugins
RoadRunner startup logs
RoadRunner startup logs