Skip to content
FLAVIO COPES
flaviocopes.com
2026

Deploying PHP applications

By Flavio Copes

Learn how to deploy PHP applications, from PHP's classic drop-a-file simplicity to modern Git deploys on a PaaS like the DigitalOcean App Platform.

~~~

When you’ve got an application ready, it’s time to deploy it and make it accessible from anyone on the Web!

PHP is the programming language with the best deployment story across the Web.

Trust me, every single other programming language and ecosystem wish they were as easy as PHP.

The great thing about PHP, the thing it got right and allowed it to have the incredible success it had, is the instant deploy.

You put a PHP file on a folder served by a Web server, voilà it just works.

No need to restart the server, run an executable, nothing.

This is still something that a lot of people do. You get a shared hosting for 3$/m, upload your files via FTP, done.

These days however I think Git deploy is something that should be baked into every project, and shared hosting should be a thing of the past.

One solution is always having your own private VPS (Virtual Private Server), which you can get from services like DigitalOcean or Linode.

But managing your own VPS is no joke, it requires serious knowledge and time investment, and constant maintenance.

(If you do go the VPS route, I built a free VPS sizing calculator that tells you how big a server you actually need for your traffic.)

You can also use the so-called PaaS (Platform as a Service), which are platforms that focus on taking care of all the boring stuff (managing servers) and you just upload your app and it runs.

Solutions like DigitalOcean App Platform (which is different from a DigitalOcean VPS), Heroku and many others are great for your first tests.

These services allow you to connect your GitHub account and deploy any time you push a new change to your Git repository.

See how to setup Git and GitHub from zero

This is a much better workflow compared to FTP uploads.

Let’s do a bare bones example.

I created a simple PHP application with just an index.php file:

<?php
echo 'Hello!';
?>

I add the parent folder to my GitHub Desktop app, I initialize a Git repo and I push it to GitHub:

GitHub Desktop showing a sample-php-app repository being published to GitHub with initial commit

Now go on digitalocean.com

If you don’t have an account yet, use my referral code to sign up get $100 free credits over the next 60 days and you can work on your PHP app for free.

I connect to my DigitalOcean account and I go to Apps → Create App.

I connect my GitHub Account and select the repo of my app.

Make sure “Autodeploy” is checked, so the app will automatically redeploy on changes:

DigitalOcean Create App form showing GitHub repository selection with Autodeploy checkbox enabled

Click “Next” then Edit Plan

DigitalOcean app resources page showing sample-php-app web service with Edit Plan button

By default the Pro plan is selected.

Use Basic and pick the $5/m plan.

NOTE: you pay $5 per month, but billing is per hour, so you can stop the app any time you want

DigitalOcean plan selection showing Basic and Pro options with Pro plan selected showing $12 monthly cost

DigitalOcean plan selection with Basic option selected showing $5 monthly pricing dropdown menu

Then go back and press “Next” until the “Create Resources” button appears to create the app. You don’t need any database otherwise that would be another $7/m on top.

DigitalOcean app configuration review page showing project details and $5 monthly cost with Create Resources button

Now wait until the deployment is ready:

DigitalOcean app dashboard showing clownfish-app deployment status with Live App button and health check running

The app is now up and running!

Browser showing deployed PHP application displaying Hello! message on DigitalOcean App Platform URL

Tagged: PHP · All topics
~~~

Related posts about php: