You can migrate your PHP application from Forge to Cloud 66 in 3 steps:
- Build and deploy your application's code via the Cloud 66 dashboard
- Import your data to your new environment
- Redirect traffic to the new endpoint
Cloud 66 does not host apps
Cloud 66 does not host applications. We automate the build and deployment of your application to the cloud provider of your choice, or your own servers (virtual or physical).
What you’ll need
Before you begin migrating your application please check you have the following:
- A Cloud 66 Account — If you don't already have one, sign up for a Cloud 66 account.
- A Git repo containing your application code — This can be a public or private repo. You can use any Git provider like GitHub / BitBucket or use your own privately hosted repo.
- A Dockerfile in your repo — Cloud 66 relies on containerisation to host and manage your application - you’ll need a Dockerfile. If you don’t have one, we have a sample below that you can use.
- A Cloud Account or Your Own Servers — See below.
Build and deploy your code
Using the Cloud 66 Dashboard, you can pull your code directly from your Git repository and build it into a new version of your application on your own servers. Follow the steps below to get up and running in under 5 mins:
1: Ensure your repo has a Dockerfile
If your application doesn’t already have a Dockerfile you can use our basic example file below and tweak it to your needs. The file should be named
Dockerfile and should be placed in the root of your repo.
Sample Dockerfile for PHP applications:
# Use the official PHP 8.0 image as the base FROM php:8.0-apache # Install system dependencies RUN apt-get update && apt-get install -y \ libzip-dev \ unzip \ && docker-php-ext-install zip pdo_mysql # Enable Apache rewrite module RUN a2enmod rewrite # Set the document root to Laravel's public directory ENV APACHE_DOCUMENT_ROOT /var/www/html/public # Copy the application files to the container COPY . /var/www/html # Set the working directory WORKDIR /var/www/html
2: Choose a source
The first thing we need is access to your code, so that we can build and deploy it for you.
The easiest option is to give us (read-only) access to a Github repo. To do this:
- Click Get Started
- On the next page click Link with Github
- We’ll send you to our app on Github (you’ll need to sign in)
- Once you’re signed in, click Configure & then select the Github account you wish to link to Cloud 66
- Install and authorize our Github app (you can restrict our access to specific repos if needed)
- You will be redirected back to your Cloud 66 dashboard and you can move on to Step 2.
If you’d prefer to use another method, you can consult the table on our main getting started guide.
Do you have a Dockerfile?
You’ll need a Dockerfile in the root of your repo or the next step won’t work. See the guide above to add one.
3: Define your application
Now that we have access to your git host, you can tell us which repo you want to deploy:
- Choose the repo you want to deploy and set the branch
- Choose an environment for your application
- Give your application a name (this will be used to label your application throughout the Cloud 66 dashboard, and will not be visible to public users.)
- Click Analyze - we will now scan your repo and suggest the optimal settings
4: Configure services
Once we have scanned your application code, we will create an image for your application. You can leave this as it is and move on to the Service configuration.
- Click Next
- Click Configure Ports in the Network column
- Set your container port to
- Set your HTTP port to
80and your HTTPS port to
- You can also define a persistent storage volume if needed
- Click Save Service
- Click Next to move to Servers & Databases
5: Add a cloud provider
A. Configure access to your cloud provider
We need access to your cloud account in order to provision and manage servers on your behalf. How you configure that access differs from provider to provider. Select your cloud provider from the dropdown for more help.
First you need to configure your AWS account to allow Cloud 66 to access it:
- Log into the web interface for your AWS account
- Click on the name of your account in the top right corner of your AWS account, and select My Security Credentials.
On the next screen, some users will be asked to choose between Security Credentials and IAM users. We support both methods but we recommend that experienced users select IAM (Identity and Access Management) for better security because allows you to set permissions for specific users. Click on your chosen option below for more instructions.
Cloud 66 supports both VPC and (for AWS accounts created before 2014) EC2-Classic. We also support reserved instances. To use a VPC, your account must conform with the default VPC guidelines.
Help with advanced AWS features:
If you delete your application from Cloud 66, your servers will not be deleted on your cloud provider unless the physical server deletion setting is turned on.
B. Add your cloud provider as a deployment target
To add your cloud credentials click the Add a Deployment Target button. This will open a panel that will enable you to grant Cloud 66 access to your provider.
Click the green Add Deployment Target button once complete.
C. Specify servers
Next you need to specify where your servers will be situated, how large they should be, and where your data will be stored:
- Choose a Server Region
- We will suggest a size for your application server - you can change it as needed
- Specify whether your datastore will share the app server (not recommended for Production), or have its own server. You can also use an existing external database server if you prefer.
6: Deploy your app
When you’re satisfied with your servers, click the Start Deployment button. During the build and deployment process you can view the log to see what’s happening behind the scenes.
You can also close the window and come back later. We will email you once the application is deployed (or if it fails).
Migrate your data
Once your code is deployed, you'll need to migrate your data across. The specifics of the process differ depending on your database, but all of them involve the same steps:
- Access your database server via SSH
- Export / dump the contents of your database into a directory
- Compress files into a single tar or zip file
- Transfer that file to a location that Cloud 66 will be able to access
- Log into your database server at Cloud 66 (Toolbelt makes this quick and easy)
- Copy the file from your Forge server to your Cloud 66 server using a command like
- Unpack your archived file(s)
- Import your data into your database (see guides linked below)
How to import data files
These guides should help you with Step 8 above:
Change your DNS
Once you're ready to serve traffic from your Cloud 66 application, you need to direct your traffic to it. For help doing this, see Configure your DNS.
Congratulations! You've deployed your first app with Cloud 66. Reach out to support if you need any help.