Deploy a website

Deploy WordPress as a website, check it, and open it in the browser.

Chapter 3 of 3 · about 6 minutes

In this chapter we will turn the WordPress we installed into a website called company-site, open it in the browser, and give it a name. By the end we'll have a WordPress site running on our own computer, deployed by Nextweb.

Name our site

A deploy starts with two names. The site name is how Nextweb refers to the site, and the domain is the address the site answers to. We use www.example.com, a domain reserved for examples:

At the nextweb prompt
deploy company-site to www.example.com using wordpress
You should see
Site "company-site" registered for www.example.com (template: wordpress).

  Site root: /home/you/nextweb-tour/nextweb_server/sites/company-site
  Status: pending — configure options, then commit and apply

Next steps:
  configure
  set company-site admin-email you@example.com
  set company-site site-title "My Site"
  exit
  commit "Deploy company-site"
  apply
  verify company-site

Notice Status: pending. Nextweb has given the site a folder and its own copy of WordPress, but nothing is switched on yet. The next steps mention a few optional settings. WordPress asks for a title and an email itself in a moment, so we go straight to saving.

Save the change

At the nextweb prompt
commit "Deploy company website"
You should see
Committed: Deploy company website
Configuration validated.
Configuration written.

Commit saves our new site into Nextweb's configuration. The words in quotes are a note to ourselves about what changed.

Switch it on

At the nextweb prompt
apply -y

Apply turns saved configuration into running software. Because that can restart services, apply asks before it starts, and the -y answers yes for us. It takes a few seconds:

You should see
Applying configuration...

Applying site configuration...
Service mariadb: running (manage with "service mariadb status" / "service mariadb restart")

Site: company-site (www.example.com)
  Allocated site listen port 4001 for company-site
  Provisioning database for site company-site...
  MariaDB running (socket /tmp/nw-maria-4475b936ba04.sock)
  Database wp_company_site and user wp_companysite ready
  Starting PHP runtime for site...
  php-cgi listening on 19100 (2 processes, opcache off)
company-site: WordPress provisioned at /home/you/nextweb-tour/nextweb_server/sites/company-site/wordpress
Service company-site: registered (manage with "service company-site status" / "service company-site restart")
Visit: http://127.0.1.10:4001/
Webserver reloaded (site listen ports bound)

Site apply complete.

Configuration changes complete!
Changes 1, Warnings 0, Errors 0

┌──────────────────────────────────────────────────────────┐
│  company-site is live → http://127.0.1.10:4001/          │
│  verify: passed · applied in 2.3 s                       │
└──────────────────────────────────────────────────────────┘
Next steps:
  open the address to finish the WordPress setup
  service logs company-site
  undeploy company-site

Read it from the top and you can watch Nextweb work. It starts MariaDB as the mariadb service, picks a port for the site, creates a database, starts PHP, sets up WordPress, and hands us a Visit address. Then it checks the site answers, and the box at the end says it is live. The socket name and port numbers on your screen may be different.

Check the site

At the nextweb prompt
verify company-site
You should see
Verifying site: company-site
wp-config.php present
state.json (domain: www.example.com, status: applied)
database configuration present in site state
HTTP check passed (200)
Response contains WordPress markers
vhost conf.d: company-site.js

Visit: http://127.0.1.10:4001/

All checks passed.

All checks passed. Notice the status changed from pending to applied, and Nextweb asked the site for a page and got WordPress back.

Open the site

Open the Visit address in your browser. Yours may end with a different port.

WordPress greets us with its own short setup:

  1. Choose a language and select Continue.
  2. Fill in Site Title (we use Example Company), a Username, a Password, and Your Email, then select Install WordPress.
  3. WordPress says Success! Now open the Visit address once more.

There it is: our website, with Example Company across the top.

What we have now

A WordPress website running on our own computer, with its own copy of WordPress, its own database, its own PHP, and its own address, all deployed by Nextweb. It took four commands: deploy, commit, apply, and verify.

How a deploy works shows what each of those four commands did.