Sites and apps
How to put a PHP site online
In short
To put a PHP site online, place index.php in the project root, keep a composer.json with your dependencies, and upload the code as an archive or from GitHub. Netrun detects PHP, installs the dependencies with Composer and gives you a link with a secure connection; the vendor folder does not need uploading. The database login and password and API keys go into secrets and reach the app as environment variables.
- A PHP site's entry point is the index.php file in the project root.
- If the project has a composer.json, Netrun installs the dependencies during the build, so there is no need to run composer install by hand.
- The vendor folder does not need uploading: the platform builds it.
- Netrun works for plain PHP as well as Laravel or Symfony projects with a standard structure.
- Netrun stores database credentials encrypted and passes them to the app as environment variables, which PHP reads with getenv().
Normally, to show a PHP site to the world, you have to rent hosting or a VPS, install and configure a web server, hook up the right version of PHP, manually pull in dependencies with Composer, write a connection string for your database and issue an SSL certificate for a secure connection. For a simple site or a pet project, that is an evening of fiddling instead of a result.
Netrun takes all that routine off your hands: you upload your code, and the platform figures out on its own that it is PHP, builds the project, installs the dependencies and gives you a public link with a secure connection. Here is how to put a PHP site online in a few minutes.
Prepare your project#
Make sure there is an index.php in the root of your project — this is the entry point where your site begins. Plain PHP works, and so does a framework project like Laravel or Symfony as long as its structure is standard. You do not need to include the dependencies folder (vendor) — the platform builds it for you.
Describe your dependencies#
If your site uses third-party libraries, keep a composer.json file in the project with the list of dependencies. Netrun will see it and install everything itself during the build — you do not need to run composer install by hand.
Upload your code#
Pack the project into a ZIP archive and drag it into Netrun, or connect a GitHub repository, including a private one. The platform detects on its own that this is PHP and starts the build — you will not have to pick the language or version by hand.
Set your secrets#
A database login and password, a connection string, API keys — anything you should not keep in your code, Netrun asks for during setup and passes into the project through environment variables (values that live next to the app rather than inside its files). In your code, read them from the environment instead of writing them straight into files.
Do not hardcode the port#
If your site starts its own web server, have it listen on the port from an environment variable — Netrun will supply the right number for you. Do not write a specific port into your code, otherwise the site may fail to open.
Check the deployment#
Follow the status and build logs right in your dashboard — they update in real time. Once everything builds, you get a public link with a secure connection. If something goes down later, Netrun restarts the project on its own.
That is it: your PHP site lives on the internet without renting a server, configuring a web server by hand or wrestling with certificates. The Free plan gives you one project, and when it is idle the site sleeps, then answers the first request a bit more slowly while it wakes up. If you need it always on with no delay, the paid plan is a good fit, and you can pay for extra places for additional sites. Try Netrun.
Common questions
How do I read an environment variable in PHP?
With getenv("DB_PASSWORD"), or through the $_ENV array if it is enabled in the PHP settings. In Laravel, values are read with env() in the config files.
Does Netrun offer a MySQL database?
There is no ready-made managed database. You can connect an external one by putting its credentials in secrets, or run one as a service next to the site with your own docker-compose. A small site can get by with SQLite: keep the database file in the persistent /data folder.
Where should I keep images that users upload to the site?
In the persistent /data folder: whatever the site writes there survives code updates and restarts. Files outside /data disappear on the next publish. You can view and download them in the Data tab of your dashboard.
What if the site shows a blank page or a 500 error?
Open the logs in your dashboard — the PHP error usually shows up there. Most often a setting or secret is missing, such as the database credentials, or the index.php entry point is not where the site expects it.
Can I host a PHP site for free?
Yes, the Free plan includes one project: the site sleeps without visitors and wakes on its own when someone opens it, with the first load after sleep taking a few seconds. To keep the site from sleeping, you need the Pro plan.