How to Deploy WordPress without Composer on Platform.sh
On this page
WordPress is a popular Content Management System written in PHP. The recommended way to deploy WordPress on Platform.sh is by using Composer, the PHP package management suite. This guide will take you through the steps of setting up “vanilla” WordPress - that is, WordPress not managed through Composer, but rather by either fully committing WordPress, themes, and plugins or defining them with submodules - on Platform.sh. It should be noted that this approach comes with certain limitations based on the way Platform.sh works, and for this reason is not recommended. Instead, consider using the “Upgrade to use Composer” guide to modify your project into one that uses Composer.
To get WordPress running on Platform.sh, you have two potential starting places:
You already have a WordPress site you are trying to deploy. Go through this guide to make the recommended changes to your repository to prepare it for Platform.sh.
You have no code at this point.
If you have no code, you have two choices:
Generate a basic WordPress site. See an example for doing this under initializing a project.
Use a ready-made WordPress template.
A template is a starting point for building your project. It should help you get a project ready for production.
To use a template, click the button below to create a WordPress template project.
Once the template is deployed, you can follow the rest of this guide to better understand the extra files and changes to the repository.
- Git. Git is the primary tool to manage everything your app needs to run. Push commits to deploy changes and control configuration through YAML files. These files describe your infrastructure, making it transparent and version-controlled.
- A Platform.sh account. If you don’t already have one, register for a trial account. You can sign up with an email address or an existing GitHub, Bitbucket, or Google account. If you choose one of these accounts, you can set a password for your Platform.sh account later.
- The Platform.sh CLI. This lets you interact with your project from the command line. You can also do most things through the Web Console.
You can start with a basic code base or push a pre-existing project to Platform.sh.
Create your first project by running the following command:
platform create --title PROJECT_TITLE
Then choose the region you want to deploy to, such as the one closest to your site visitors. You can also select more resources for your project through additional flags, but a Development plan should be enough for you to get started.
Copy the ID of the project you've created.
Get your code ready locally.
If your code lives in a remote repository, clone it to your computer.
If your code isn't in a Git repository, initialize it by running
If you don’t have code, create a new WordPress project from scratch. It’s best to place WordPress core into a subdirectory rather than at the project root. The following commands create a fresh Git repository with WordPress as a subdirectory:
mkdir wordpress-psh && cd wordpress-psh git clone https://github.com/WordPress/WordPress.git wordpress && rm -rf wordpress/.git git init
Connect your Platform.sh project with Git. You can use Platform.sh as your Git repository or connect to a third-party provider: GitHub, GitLab, or BitBucket.
Now you have a local Git repository, a Platform.sh project, and a way to push code to that project. Next you can configure your project to work with Platform.sh.