Setup
You can pick your drupal version from https://hub.docker.com/_/drupal/tags ; you'll get security update reminders so you might want to get the newest you can.
First you have to "seed" the "sites" directory:
docker run --rm drupal:<VERSION> tar -cC /var/www/html/sites . | tar -xC <LOCAL DRUPAL PATH>/sites
Then run the Drupal image in a container named "drupal":
docker run --detach \
--hostname hadronrider.chickenkiller.com \
--publish <INTERNAL HTTP PORT>:80 \
--name drupal \
--restart always \
--volume <LOCAL DRUPAL PATH>/modules:/var/www/html/modules \
--volume <LOCAL DRUPAL PATH>/profiles:/var/www/html/profiles \
--volume <LOCAL DRUPAL PATH>/sites:/var/www/html/sites \
--volume <LOCAL DRUPAL PATH>/themes:/var/www/html/themes \
drupal:<VERSION>
Reverse proxy
If you're a fan of this site you should have set NGINX up as a reverse proxy and might want to insert the following in the main "server" block (the one listening on port 443) in /etc/nginx/sites-available/default:
location /
{
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Accept-Encoding "";
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-NginX-Proxy true;
proxy_http_version 1.1;
add_header Front-End-Https on;
proxy_connect_timeout 600;
proxy_send_timeout 600;
proxy_read_timeout 600;
location / {
rewrite /(.*) /$1 break;
proxy_pass http://127.0.0.1:<INTERNAL PORT>/;
}
}
Back to top
"Drupal composer" repository/available modules
You can install components like Highlight JS or TOCFilter (described below) by just running "docker exec drupal drupal composer require '<package>'"
You can browse available modules here:
https://www.drupal.org/project/project_module
Sending emails
Emails are needed to automate account management and get problem reports and notifications if you're the admin.
You can use a mail sending service like Mailgun or set up your own mailserver.
Once you have it:
- install the SMTP extension:
docker exec drupal composer require 'drupal/smtp'
- go to Manage -> Extend -> find and tick "SMTP Authentication Support" then click Save
- go to Manage -> Configuration -> SMTP Authentication Support and enter all your SMTP server details
You should get a green confirmation popup when the page reloads:

Themes: Solo
The best Drupal theme according to many (including me) is Solo. You can install it by running:
docker exec drupal composer require 'drupal/solo'
Then go to your drupal website (as an admin), Manage -> Appearance -> under "Uninstalled themes", find Solo and click "Install and set as default".
After the procedure is complete and the theme appears under "Installed themes", click Settings to start model the theme to suit your needs.
You can find everything Solo on the website https://www.drupal.org/node/3405889 and the YouTube playlist https://www.youtube.com/playlist?list=PLZVSLeSmRrd1nqYAFOyalLvy5YP0dSJjJ
Syntax highlighting
To enable code blocks highlighting, install "highlight_js":
docker exec drupal composer require 'drupal/highlight_js'
go to Manage -> Extend -> find and tick "Highlight Js syntax highlighter" then click Save
go to Manage -> Configuration -> Highlight JS Configuration, enable all the languages you want and then click Save Configuration
go to Manage -> Configuration -> Text formats and editors, click Full HTML and tick Highlight JS to enable syntax highlighting for "full HTML" displays
go to Manage -> People -> Permissions, find Highlight Js syntax highlighter and enable it for content editors
Table of contents
Install by:
docker exec drupal composer require 'drupal/toc_filter'
Go to Manage -> Extend -> find and tick "TOC Filter" then click Save
Go to Manage -> Configuration -> Text formats and editors, click Full HTML and tick "Display a table of contents", then scroll to the bottom and adjust the settings in the "Display a table of contents" configuration section to your liking.
Go to Manage -> Structure, scroll to the section you want to place the TOC in, click Place block, "Table of contents", configure and Save block (you can then simply drag it to a different block if you need), then Save Blocks.
Back to top
Comments