How To

Install Neos CMS with Devbox

28 May 2025

A

fter using Docker for years (and being less and less satisfied with the experience on a Mac), I was looking for alternative and - most importantly - easy and painless to use dev environments. I found Devbox. And I like it!
So, in this tutorial, we're going to install Neos CMS with the Neos.Demo site package using Devbox
Let's dive in!
 

Info

While I'm using macOS, you should be able to follow along for other operating systems as well. Devbox can be installed on various systems.
 

Prerequisites

Install Devbox (You can look it up here for other OS):

curl -fsSL https://get.jetify.com/devbox | bash

For this tutorial, we assume a project directory neos-devbox. You can choose any name, of course.
 

Init Devbox

Open a terminal window and type:

$ mkdir neos-devbox $ cd neos-devbox $ devbox init

A devbox.json file is created. It's pretty empty for now, but the packages you add to your Devbox are saved here, as well as the scripts you might add for convenience. It's very similar to the package.json of NPM managed applications.
 

Checking requirements

As our goal is to setup a environment for our Neos project, let's check the requirements for the framework in the official docs

We're going to install Neos 9 on PHP 8.3 with MariaDB and Apache. Neos (or rather Flow, the underlying PHP Framework) needs some PHP modules to function, so we'll add them, too. For image processing, we choose ImageMagick. Since Neos and its packages are (thankfully!) Composer managed, Composer is added into the mix as well.
 

Finding packages

Devbox lets you search for packages with devbox search <package> or devbox search <language>. So if you want to look around, try devbox search php.
 

Installing packages

Adding required packages is straight forward. Just use devbox add <package> and you're good to go.

For Neos, the command with all the required packages looks like this:

devbox add php@8.3 php83Packages.composer php83Extensions.imagick mariadb@latest

I like to install node.js as well, because I use NPM to handle my frontend stack. A simple devbox add nodejs@22 will do. We're installing a specific version here - when in doubt, I like to go with LTS versions.

Executing the add command installs the packages. You get feedback for every single one, e.g. if and how you can set environment variables. You can always access the info for each package again by running devbox info <package>.

By now, you're devbox.json should look something like this:

devbox.json
{ "$schema": "https://raw.githubusercontent.com/jetify-com/devbox/0.14.2/.schema/devbox.schema.json", "packages": [ "php@8.3", "php83Packages.composer@latest", "php83Extensions.imagick@latest", "mariadb@latest", "nodejs@22" ], "shell": { "init_hook": [ "echo 'Welcome to devbox!' > /dev/null" ], "scripts": { "test": [ "echo \"Error: no test specified\" && exit 1" ] } } }

Start devbox

Let's start up devbox with devbox shell

On the first run, it's ensured that every package in your devbox.json is actually installed. The first time, you'll see some info and recommendations (e.g. to install MariaDB securley, and so on), but now, you're logged in your devbox server.

You can check with php -v and you should see an output like this:

PHP 8.3.21 (cli) (built: May 6 2025 13:58:10) (NTS) Copyright (c) The PHP Group Zend Engine v4.3.21, Copyright (c) Zend Technologies with Zend OPcache v8.3.21, Copyright (c), by Zend Technologies

Exit devbox

To exit the devbox shell, just type exit in the open terminal session. 
To go back in to interact with your application on your server, just run devbox shell in your root directory (in this case neos-devbox) again.
 

Adding scripts to devbox

Our basic environemt is set up, let's continue with configuring some scripts inside the devbox.json file to help us (and contributors or team members) to install the application.

Open up devbox.json and add the following scripts - you can remove the test scripts added upon installation or keep them, it does not matter.

devbox.json
"shell": { "init_hook": [], "scripts": { "composer:create-project": [ "composer create-project neos/neos-base-distribution source" ], "db:create": "mysql -u root -e 'CREATE DATABASE neos_devbox;'" } }

If you're familiar with NPM and its package.json, those scripts probably are not news to you. You can define a key / name of your command (e.g. composer:create-project) and one (single line) or mulitple (one command in every line) commands to be executed upon calling the script.

So, to run a command, open up a new terminal window. It's important that you execute those scripts in your root directory but not while logged into devbox shell. Like devbox add, running scripts is easy, you just type devbox run <script-name>.

Our two scripts serve the purpose to add a new database for our application and to create the neos project with composer.
 

Add database

We need to start the services in our dev environment. MariaDB, PHP-FPM, etc. need to run for us to work with. We can start them with devbox services up and stop them with devbox services stop (or hitting CTRL + C in the respective terminal window).
You can also start a specif service with devbox services up mariadb -b (-b launches it in the background without a fancy terminal output).

We're going to start all services now in a new window:

devbox services up

You'll see an output with MariaBD and its logs as well as PHP-FPM running.

In a separate window (again, not in devbox shell), let's run the script to create our database:

devbox run db:create

The database with the name you chose in the create table statement has been created. 

You can check and interact with mysql via terminal in devbox shell, but I like to use a GUI for database handling most of the time. I use Sequel Ace or TablePlus, but you can use whatever you're accustomed to.
The configuration is really easy, it's just entering the host (127.0.0.1) and username (root) and connect to the database. You should see and be able to select the newly created database neos_devbox.

Since this is your local dev environment only, you do not need to configure a separate user and password and can just use root. If you want to or are uncomfortable with it, check out user creation and granting permissions to users and tables in MySQL.
 

Install Neos

Finally, let's install Neos itself. It's going to require a few steps, but I'll run you through it.

In a new window, run:

devbox run composer:create-project

You'll see composer doing its job downloading and installing all required packages. But after the output of ./flow welcome and a pretty ASCII illustration of the Neos logo, the installation will abort. This is due to the fact that the php binary can not be localized. 
But, fortunately, the output is already telling us the correct path and where to put it.

Basic system requirements Could not start a flow subprocess. Maybe your PHP binary "/nix/store/jpbgh919wv9b385mdyjwz98w1x2n9pjw-php-8.3.21/bin/php" (see Configuration/Settings.yaml) is incorrect: "You are running the Flow CLI with a PHP binary different from the one Flow is configured to use internally. Flow has been run with "/nix/store/671kccn1vbqiya334605rp5rj1zj6g23-php-with-extensions-8.3.21/bin/php", while the PHP version Flow is configured to use for subrequests is "/nix/store/jpbgh919wv9b385mdyjwz98w1x2n9pjw-php-8.3.21/bin/php". Make sure to configure Flow to use the same PHP binary by setting the "Neos.Flow.core.phpBinaryPathAndFilename" configuration option to "/nix/store/671kccn1vbqiya334605rp5rj1zj6g23-php-with-extensions-8.3.21/bin/php". Flush the caches by removing the folder Data/Temporary before running ./flow again.". You might want to configure it to: "/nix/store/671kccn1vbqiya334605rp5rj1zj6g23-php-with-extensions-8.3.21/bin/php". Open Data/Logs/Exceptions/20250528152626bc5185.txt for a full stack trace.

Essential are the infos "Neos.Flow.core.phpBinaryPathAndFilename" in Configuration/Settings.yaml and the correct php binary path /nix/store/671kccn1vbqiya334605rp5rj1zj6g23-php-with-extensions-8.3.21/bin/php. Your path to nix/store/ of course will be different and you'll have to use your path.

In your IDE, navigate to source/Configuration/Development and add a new file Settings.yaml. Besides the php binary, we'll configure the database connection, image processing and baseUri as well.

Settings.yaml
Neos: Imagine: driver: Imagick enabledDrivers: Imagick: true Flow: persistence: backendOptions: driver: pdo_mysql host: 127.0.0.1 port: 3306 user: root password: '' dbname: 'neos_devbox' core: phpBinaryPathAndFilename: '/nix/store/671kccn1vbqiya334605rp5rj1zj6g23-php-with-extensions-8.3.21/bin/php' http: baseUri: 'http://127.0.0.1:8081/' trustedProxies: proxies: '*'

After adding this file, we continue with the setup. Answer the prompts for backend user creation.

$ devbox shell $ cd source $ ./flow doctrine:migrate $ ./flow user:create --roles Administrator $ ./flow cr:setup --content-repository default $ ./flow site:importall --package-key Neos.Demo

To check your installtion, run:

./flow server:run

All steps should be highlighted green and the descirption be like services running, scripts executed, and so forth.
 

Start flow server

In devbox shell, run:

./flow server:run

Open http://127.0.0.1:8081 in your browser. You installed Neos CMS! ðŸ¥³

You can access the backend with http://127.0.0.1:8081/neos and login with the credentials you entered when executing the command ./flow user:create --roles Administrator.
 

Add Flow server script to devbox

To easily start all our required services when we want to run our application, let's add another script to the devbox.json, e.g. below the db:create script.

"server:run": [ "cd source", "./flow server:run" ]

So the next time you need to start your Neos site and access it, you'll only need to run:

$ devbox services up $ devbox run server:run

Next time, we're going to start our own site package without Neos.Demo to get to know Neos internal workings with NodeTypes, Prototypes, Fusion and AFX. 

Stay tuned!

TL;DR or Copy Pasta is king! 😄

$ mkdir neos-devbox $ cd neos-devbox $ devbox init $ devbox add php@8.3 php83Packages.composer php83Extensions.imagick mariadb@latest nodejs@22 $ devbox services up (Extend scripts in `devbox.json`.) $ devbox run db:create $ devbox run composer:create-project (Add Settings.yaml with phpBinary path.) $ devbox shell $ cd source $ ./flow doctrine:migrate $ ./flow user:create --roles Administrator $ ./flow cr:setup --content-repository default $ ./flow site:importall --package-key Neos.Demo $ ./flow server:run
Tags: