Skip to content

Commit abe152a

Browse files
committed
drupal cms guide
1 parent a94807b commit abe152a

File tree

4 files changed

+182
-4
lines changed

4 files changed

+182
-4
lines changed

CHANGELOG.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
## {{ UNRELEASED_VERSION }} - [{{ UNRELEASED_DATE }}]({{ UNRELEASED_LINK }})
22

33
* Updated globally installed Drush to `v8.5.0`.
4-
* Added `Drupal CMS` instructions to the Getting Started docs.
5-
4+
* Added docs for setting up [Drupal CMS](https://drupal.org/docs/drupal-cms).
65
* Updated to [@lando/php@1.7.1](https://github.com/lando/php/releases/tag/v1.7.1).
76
* Updated to [@lando/mysql@1.5.0](https://github.com/lando/mysql/releases/tag/v1.5.0).
87

docs/config.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@ config:
2626
vhosts: SEE BELOW
2727
```
2828
29-
Note that if the above config options are not enough all Lando recipes can be further [extended and overriden](https://docs.lando.dev/landofile/recipes.html#extending-and-overriding-recipes).
29+
Note that if the above config options are not enough, all Lando recipes can be further [extended and overriden](https://docs.lando.dev/landofile/recipes.html#extending-and-overriding-recipes).
30+
31+
::: tip Applying Configuration Changes
32+
After making changes to service configurations, you'll need to run `lando rebuild` for the changes to take effect. This rebuilds your app's services with the new configuration.
33+
:::
3034

3135
## Choosing a Drupal version
3236

docs/getting-started.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ lando start
6363
lando composer create-project drupal/cms tmp && cp -r tmp/. . && rm -rf tmp
6464
6565
# Install drupal
66-
lando drush site:install --db-url=mysql://drupal11:drupal11@database/drupal11 -y
66+
lando drush site:install recipes/drupal_cms_starter --db-url=mysql://drupal11:drupal11@database/drupal11 -y
6767
6868
# List information about this app
6969
lando info

docs/guides/drupal-cms.md

+175
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,175 @@
1+
---
2+
title: Installing Drupal CMS Locally with Lando
3+
description: This guide will walk you through setting up Drupal CMS locally for development using Lando
4+
5+
authors:
6+
- name: Aaron Feledy
7+
pic: https://avatars.githubusercontent.com/u/1000487
8+
link: https://x.com/aaronfeledy
9+
---
10+
11+
# Installing Drupal CMS with Lando
12+
13+
[Drupal CMS](https://drupal.org/drupal-cms) is a new product that puts the power of Drupal into the hands of marketers, designers and content creators. It's built on Drupal 11 and comes with smart defaults and AI-powered features to help you launch your site quickly.
14+
15+
This guide will walk you through setting up Drupal CMS locally for development using Lando.
16+
17+
<details>
18+
<summary>TLDR; Quick Install Commands</summary>
19+
20+
::: code-group
21+
22+
```bash:no-line-numbers [Bash]
23+
# Prompt for app name (or change this line to set it directly)
24+
read -p "Enter your app name [my-drupalcms-app]: " APP_NAME
25+
APP_NAME=${APP_NAME:-my-drupalcms-app} # Default if no input provided
26+
27+
# Create and initialize project
28+
mkdir $APP_NAME \
29+
&& cd $APP_NAME \
30+
&& lando init \
31+
--source cwd \
32+
--recipe drupal11 \
33+
--webroot web \
34+
--name $APP_NAME
35+
36+
# Start environment and install Drupal CMS
37+
lando start
38+
lando composer create-project drupal/cms tmp && cp -r tmp/. . && rm -rf tmp
39+
lando drush site:install recipes/drupal_cms_starter --db-url=mysql://drupal11:drupal11@database/drupal11 -y
40+
41+
# Get site URL to login
42+
lando drush user:login /admin/dashboard/welcome --uri="$(lando info -s appserver --path 'urls[1]' | tr -d '\n' | tr -d "'")"
43+
```
44+
45+
```powershell:no-line-numbers [PowerShell]
46+
# Prompt for app name (or change this line to set it directly)
47+
$APP_NAME = Read-Host "Enter your app name [my-drupalcms-app]: "
48+
if ([string]::IsNullOrWhiteSpace($APP_NAME)) { $APP_NAME = "my-drupalcms-app" }
49+
50+
# Create and initialize project
51+
mkdir $APP_NAME; `
52+
cd $APP_NAME; `
53+
lando init `
54+
--source cwd `
55+
--recipe drupal11 `
56+
--webroot web `
57+
--name $APP_NAME
58+
59+
# Start environment and install Drupal CMS
60+
lando start
61+
lando composer create-project drupal/cms tmp; cp -r tmp/* .; rm -rf tmp
62+
lando drush site:install recipes/drupal_cms_starter --db-url=mysql://drupal11:drupal11@database/drupal11 -y
63+
64+
# Get the login link
65+
lando drush user:login /admin/dashboard/welcome --uri="$(lando info -s appserver --path 'urls[1]' | tr -d '\n' | tr -d "'")"
66+
```
67+
68+
:::
69+
70+
</details>
71+
72+
## Prerequisites
73+
74+
Before starting, you'll need:
75+
76+
1. [Lando installed on your system](https://docs.lando.dev/getting-started/installation.html)
77+
2. Basic familiarity with command line tools
78+
3. A terminal application
79+
80+
## Installation Steps
81+
82+
1. **Create and enter project directory**
83+
84+
First, we'll create a new directory for our Drupal CMS project files and navigate into it:
85+
86+
```bash:no-line-numbers
87+
mkdir my-drupalcms-app
88+
cd my-drupalcms-app
89+
```
90+
91+
2. **Initialize a new Lando app with Drupal 11 recipe**
92+
93+
Now that we have our project directory, let's set up the Lando configuration. We'll use the `lando init` command to create a `.lando.yml` file that will define our development environment. We'll tell it to use the `drupal11` recipe since that's what Drupal CMS is built on, and specify that our web files will live in a 'web' directory:
94+
95+
```bash:no-line-numbers
96+
lando init \
97+
--source cwd \
98+
--recipe drupal11 \
99+
--webroot web \
100+
--name my-drupalcms-app
101+
```
102+
103+
3. **Start the Lando environment**
104+
105+
With the Lando configuration in place, start the development environment by running the command below. This
106+
will take a few minutes the first time as Lando downloads and configures everything needed to host Drupal CMS locally:
107+
108+
```bash:no-line-numbers
109+
lando start
110+
```
111+
112+
4. **Install Project Files via Composer**
113+
114+
Now that the environment is running, we use Composer to download and install the Drupal CMS project files.
115+
116+
```bash:no-line-numbers
117+
lando composer create-project drupal/cms tmp && cp -r tmp/. . && rm -rf tmp
118+
```
119+
120+
5. **Install Drupal**
121+
122+
With the environment running and the project files in place, we need to configure Drupal to use Lando's database service, create the database, and run Drupal's installation process. Fortunately, Drush makes this easy with its `site:install` command:
123+
124+
```bash:no-line-numbers
125+
lando drush site:install recipes/drupal_cms_starter --db-url=mysql://drupal11:drupal11@database/drupal11 -y
126+
```
127+
128+
## Post-Installation
129+
130+
Now that Drupal CMS is installed and running, it's time to login. We'll use the `lando drush user:login` command to generate a one-time login link:
131+
132+
```bash:no-line-numbers
133+
lando drush user:login /admin/dashboard/welcome --uri="$(lando info -s appserver --path 'urls[1]' | tr -d '\n' | tr -d "'")"
134+
```
135+
136+
2. Start exploring the [Drupal CMS interface](https://new.drupal.org/docs/drupal-cms/get-started/get-to-know-drupal-cms/getting-around-drupal-cms) and its features like:
137+
- The Dashboard
138+
- Content management tools
139+
- Built-in SEO tools
140+
- [Smart default recipes](https://new.drupal.org/docs/drupal-cms/get-started/get-to-know-drupal-cms/adding-functionality-with-smart-defaults) for common functionality
141+
- [AI tools](https://new.drupal.org/docs/drupal-cms/get-to-know-drupal-cms/ai-tools-in-drupal-cms) for site administrators and content creators
142+
143+
## Customizing Your Setup
144+
145+
Lando's Drupal plugin offers many configuration options. You can customize:
146+
147+
- PHP version
148+
- Web server (Apache or Nginx)
149+
- Database backend (MySQL, MariaDB, or PostgreSQL)
150+
- Composer version
151+
- And more
152+
153+
For detailed configuration options, see the [Lando Drupal Plugin Configuration Documentation](https://docs.lando.dev/plugins/drupal/config.html).
154+
155+
## Starting and Stopping
156+
157+
- To stop your local environment: `lando stop`
158+
- To start it again: `lando start`
159+
- To rebuild the environment: `lando rebuild`
160+
161+
## Next Steps
162+
163+
Now that you have Drupal CMS running locally, you can:
164+
165+
1. [Get familiar with the Drupal CMS features and interface](https://new.drupal.org/docs/drupal-cms/get-started/get-to-know-drupal-cms)
166+
167+
## Troubleshooting
168+
169+
If you encounter issues during installation:
170+
171+
- Try running `lando rebuild -y` to rebuild your app with the latest configuration
172+
- Check Lando's [troubleshooting guide](https://docs.lando.dev/help/troubleshooting.html)
173+
- Join the [Lando Slack](https://www.launchpass.com/devwithlando) for community support
174+
175+
Remember to check the [Drupal CMS documentation](https://drupal.org/docs/drupal-cms) for detailed information about working with Drupal CMS.

0 commit comments

Comments
 (0)