Skip to content

Added deployment Steps on Cloudways #7433

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 11 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added _images/deployment/cloudways/db-info.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/deployment/cloudways/http_url.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/deployment/cloudways/launch-server.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/deployment/cloudways/mysql-access.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/deployment/cloudways/select-provider.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/deployment/cloudways/symfony-7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/deployment/cloudways/symfony-8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/deployment/cloudways/symfony-home.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
159 changes: 159 additions & 0 deletions deployment/cloudways.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
.. index::
single: Deployment; Deploying to Cloudways Cloud Servers

Deploying to Cloudways
======================

Cloudways is a managed hosting provider for PHP based applications. This step by
step article describes how to install Symfony on Cloudways servers and how to
deploy Symfony applications using Git and SSH.

Step 1: Prepare your Server and Application
-------------------------------------------

`Sign up`_ or login to your **Cloudways account** and create a new server by
selecting PHP Stack from the **Select your Application** drop-down. Also, name
your application, server and project accordingly.

.. image:: /_images/deployment/cloudways/select-application.png
:alt: Select PHP Stack in Drop down

Step 2: Select a Cloud Provider
-----------------------------

Now select your favorite cloud provider. You can select any one from the five
providers to install Symfony.

.. image:: /_images/deployment/cloudways/select-provider.png
:alt: Select cloud Provider

Step 3: Select Server Size & Location
-------------------------------------

In the **Server Size** field, scale the server as your requirement (**1GB**
is the minimum recommended size for Symfony applications).

.. image:: /_images/deployment/cloudways/select-server-size.png
:alt: Select server size

Keeping the latency difference in mind, now select your server location in the
**Location** field.

.. image:: /_images/deployment/cloudways/select-server-location.png
:alt: Select server location

To launch your server, click on the **Launch** button at the bottom right side
of the page.

.. image:: /_images/deployment/cloudways/launch-server.png
:alt: launch server

Step 4: Server Timezone
-----------------------

Once the server is completely launched, set the server timezone, because Symfony
requires to define a valid timezone for PHP. Under **Server Management**, go to
**Settings & Packages.**

.. image:: /_images/deployment/cloudways/server-management.png
:alt: server management tab

In the **Basic** tab you can see **PHP Timezone.** Change the server timezone to the
appropriate value according to your location.

.. image:: /_images/deployment/cloudways/server-timezone-1.png
:alt: Select server timezone

Step 5: SSH Terminal
--------------------

After changing the server timezone, in **Server Management** click on **Launch SSH
Terminal** under **Master Credentials** where you can find your login
credentials for SSH Terminal.

.. image:: /_images/deployment/cloudways/master-credentials.png
:alt: Cloudways Master Credentials

Login to SSH with your Master Credentials.

.. image:: /_images/deployment/cloudways/symfony-7.png
:alt: login to SSH

Since the application folder contains an ``index.php`` file by default, remove it
from your ``public_html/`` directory executing the ``rm -Rf *`` command.

Step 6: Symfony Installation
----------------------------

Now in your ``public_html/`` directory, run the following command to install
Symfony 3 on your server:

.. code-block:: terminal

$ composer create-project symfony/framework-standard-edition your_project_name "3.1.*"

This command will create a Symfony project in ``public_html/``. You can also
change the version number to install any other Symfony version.

Step 7: DB Information and Finishing Project Installation
---------------------------------------------------------

Now Symfony will start downloading to your server. During downloading, it will
ask for your database information.

.. image:: /_images/deployment/cloudways/db-info.png
:alt: database information

You can find out your DB information under **Application Management** go to
**Access detail** and see MySQL Access.

.. image:: /_images/deployment/cloudways/mysql-access.png
:alt: database information

After providing database information, you will see the following screen which
means that Symfony has been installed successfully.

.. image:: /_images/deployment/cloudways/symfony-installed.png
:alt: Final Symfony Installation

Step 7: Running in Browser
--------------------------

After a successful installation, in **Application Management** go to **Access
detail** and copy your Application URL.

.. image:: /_images/deployment/cloudways/mysql-access.png
:alt: database information

Open your favorite web browser and access to the "Symfony Welcome page" using
the following URL: http://your_staging_url/web

This is how the Symfony Welcome page should look like:

.. image:: /_images/deployment/cloudways/symfony-home.png
:alt: symfony homepage

Finally your Symfony project is ready for development.

Deploying From GitHub
======================

You can also deploy Symfony applications from GitHub. First, copy the HTTP URL
of the repository:

.. image:: /_images/deployment/cloudways/http_url.png
:alt: symfony homepage

Then, open the SSH terminal on Cloudways using Master Credentials as shown in
Step 5. Move to your project folder and run the clone command:

.. code-block:: terminal

$ cd application/{your app folder}/public_html
$ git clone https://github.com/username/your-repository.git

After a successful deployment, change your database credentials in
**parameters.yml**. You can find your database credentials in **Access details**
as stated in step 7.

.. _`Sign up`: https://platform.cloudways.com/signup