1

I create my last laravel app using docker, but I don't have any idea, how I can host my app?

I have phpMyadmin container and laravel app container. How I can use it with whm server? The most of users do that using docker cloud, but I don't find any tutorials or article talk about docker whm hosting what is the best practices doing that?

Boutamente abdessamad
  • 523
  • 2
  • 10
  • 30

1 Answers1

2

cPanel does not have Docker by default. If you have root access to machine which runs cPanel of course you can install it but you will not be able to control it via cPanel.

You can check these cPanel support pages:

https://support.cpanel.net/hc/en-us/articles/360062418794-Can-I-run-docker-on-a-cPanel-server-

https://support.cpanel.net/hc/en-us/articles/4402393047703-How-To-Install-Docker-Compose-

And I think you don't have root access to that shared machine. Therefore I think you are just looking for a way to publish your Laravel application on a shared hosting.

A basic Laravel application needs it's files on a server and a database connection (if needed). cPanel can provide both of this. You can upload your Laravel application files to your cPanel Website users home folder, arrange directory structure and point that Website's HTTP requests to your application's public folder.

You can use cPanel's File Manager or connect your server with a FTP client to upload and rearrange your application's files.

An application needs a database connection. In cPanel you can create a MySQL database and a MySQL user for it. Then you can change your database connection settings according to them.

You can check some other StackOverflow answers and tutorials for "Publising Laravel on a cPanel shared hosting"

How do I upload a laravel project on cPanel shared hosting?

https://medium.com/@kajan746/how-to-host-laravel-project-on-cpanel-83389d6d31e6

But as I said before; this has nothing with Docker. Those instructions shows how to use file manager and mysql wizards to prepare a production environment for Laravel on a shared cPanel host.

Uğur Arıcı
  • 1,180
  • 1
  • 10
  • 16
  • Thank you I already deployed laravel apps to cpanel servers but always you should fix compatability versions errors like php version and server errors, I use docker to resolve this problems but in this case I can't I don't have root access – Boutamente abdessamad Jan 28 '22 at 01:08