How to publish Laravel on Cloudways?

by raphael_tillman , in category: Third Party Scripts , 6 months ago

How to publish Laravel on Cloudways?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by elisha_langworth , 6 months ago

@raphael_tillman 

To publish a Laravel project on Cloudways, follow these steps:

  1. Sign up for a Cloudways account: Go to the Cloudways website (https://www.cloudways.com/) and sign up for an account. Once signed up, log in to your account.
  2. Select your application and server: After logging in, click on the "Launch" button under the "Applications" tab. Choose Laravel as your application from the available options. Then, select the desired server (cloud provider like AWS, Google Cloud, DigitalOcean, etc.), server size, and location.
  3. Complete the server setup: Fill in the required information for your server, such as the application name, server size, and location. You can also set up an SSH key, database, and other advanced settings if needed. Click on the "Launch Now" button to proceed.
  4. Connect to your server via SSH: Once the server setup is complete, click on the "Connect via SSH" button to access your server through an SSH client like PuTTY or Terminal.
  5. Set up Git and Composer: In the terminal, install Git and Composer if they are not already installed. Use the following commands: For Git: sudo apt-get install git For Composer: curl -sS https://getcomposer.org/installer | php mv composer.phar /usr/local/bin/composer
  6. Clone your Laravel project: Change to the appropriate directory and clone your Laravel project repository from a platform like GitHub or Bitbucket. Use the following command: git clone [repository URL]
  7. Install project dependencies: Once the project is cloned, navigate inside your project directory and install the required dependencies using Composer: composer install
  8. Set up your .env file: Rename the .env.example file to .env and set up your environment-specific configurations, such as database credentials and application-specific settings.
  9. Generate an application key: Generate an application key using the following command: php artisan key:generate
  10. Run database migrations (if needed): If your application requires database migrations, run them using the following command: php artisan migrate
  11. Configure your Cloudways application: Go back to the Cloudways console, click on "Applications" and then select your Laravel application. Under the "Access Details" section, you can configure your domain name, SSL settings, and other details. Make the necessary changes and save the settings.
  12. Deploy your Laravel application: In the Cloudways console, navigate to the "Deployment" tab. Click on the "Upload and Deploy" button, select your Laravel project directory on your local machine, and upload the project ZIP file. Once uploaded, click on "Deploy Now" to deploy your application to Cloudways.
  13. Test your Laravel application: After the deployment is complete, test your Laravel application using the provided domain name or IP address. Ensure that everything is functioning as expected.


Congratulations! You have successfully published a Laravel application on Cloudways.