Installing October CMS on Cloudways

Tutorial

On this page

Cloudways is a managed cloud hosting platform. It runs your website on a server from DigitalOcean, Vultr, Linode, Amazon Web Services or Google Cloud, and looks after the server for you. Servers come with PHP, MySQL and Composer ready to use, along with free Let's Encrypt SSL certificates. This article launches a server on Cloudways Flexible with a custom PHP application, installs October CMS on it over SSH and sets up the scheduler.

Before You Begin

Sign up for Cloudways. The code OCTOBERCMS takes 20% off for the first 3 months.

October CMS requires PHP 8.2 or higher, which you set on the server below.

The installer asks for your License Key, so have it ready from your October CMS account before you start.

Launch a Server

In the Cloudways Platform, launch a new server on Cloudways Flexible:

  1. Choose Custom App as the application. This is the option for any PHP application, which you install yourself.
  2. Name the application and the server, for example October CMS.
  3. Choose a cloud provider, the server size and its location.
  4. Click Launch Now.

The server takes a few minutes to launch. To use a server you already have, open it and click Add Application instead, choosing Custom App in the same way.

Set the PHP Version

Open the server and go to Server Management → Settings & Packages → Packages. Set the PHP version to 8.2 or higher and save the change.

Note: The PHP version can also be set for a single application under Application Management → Application Settings, leaving other applications on the server unchanged.

Find the Application Details

Open the application and go to Application Management → Access Details. Note the following, as the installer asks for them:

  • Application URL, a temporary address ending in cloudwaysapps.com that works before you add your own domain.
  • MySQL Access, the database name, username and password.

The application's files live in its public_html folder, at /home/master/applications/{folder}/public_html. The folder name is shown under Application Management → Application Settings.

Open the SSH Terminal

Go to Server Management → Master Credentials and click Launch SSH Terminal. Sign in with the username and password shown there. You can also connect with your own SSH client, using the same credentials and the server's public IP address.

Change to the application's public_html folder, replacing {folder} with your application's folder name.

cd /home/master/applications/{folder}/public_html

The remaining commands in this article are run from this folder.

Create the Project

A new custom application comes with a placeholder index.php file. Composer needs an empty folder, so remove it first. Run ls -A afterwards to check that nothing else is left.

rm index.php

Create the project with Composer. The dot at the end installs October CMS into the current folder, which is the application's web root.

composer create-project october/october .

Install October CMS

Run the installation command.

php artisan october:install

The installer asks a series of questions. Use the following answers for Cloudways, pressing ENTER to accept a default value shown in brackets.

Prompt Answer
Select Language en, or another language code from the table
Application URL The Application URL from Access Details, or your own domain if it already points to the server
Backend URI /admin (or a custom address for the admin panel)
Database Engine MySQL
Database Host localhost
Database Port 3306
Database Name The database name from MySQL Access
Database Login The username from MySQL Access
Database Password The password from MySQL Access
Install the demonstration theme and content? yes
License Key Your license key

After the license key is accepted, the installer downloads the October CMS packages with Composer.

Tip: If the installation appears to freeze after entering the license key, press the ENTER key several times to allow the process to continue.

The last step is the migration command that initializes the database.

php artisan october:migrate

Open the Website

Open the Application URL in your browser to see the website. Add /admin to the URL (or the custom backend URI you chose) to open the admin panel and create your first administrator account.

Note: If the website shows an error about writing to the storage folder, reset the application's file and folder permissions under Application Management → Application Settings.

Set Up the Scheduler

October CMS runs its scheduled tasks from a cron job that runs every minute. Go to Application Management → Cron Job Management, open the Advanced tab and add the following line, replacing {folder} with your application's folder name.

* * * * * cd /home/master/applications/{folder}/public_html && php artisan schedule:run >> /dev/null 2>&1

If you set the PHP version for this application only, use the full path to that version's PHP binary in place of php, as cron jobs added on the Advanced tab use the server's default version.

Add Your Domain

When you are ready to go live, add your domain under Application Management → Domain Management and point its DNS records to the server's public IP address. Then install a free certificate under SSL Certificate with Let's Encrypt.

Update the APP_URL value in the .env file in public_html to your domain, and review the production configuration before launching the website.

Tip: For an extra layer of security, you can serve the website from a public folder. After creating it, set the Webroot to public_html/public under Application Management → Application Settings.

See Also

Was this article helpful?

comments powered by Disqus
Still need help?
October Forum

Community members share experiences, ask questions and exchange tips.

Discord

Talk with other October CMS developers in real time.

Custom Development

Hire the October CMS team to work on your website.

Contact Us

For bug reports and help with this website. See the roadmap or submit an idea on the Portal.