NetrunHome

How to put a Laravel site online

· 5 min read

Laravel starts on your own machine with a single command, but putting it online traditionally turns into a separate project: a server, the right PHP version with extensions, composer, nginx with the correct root in the public folder, php-fpm, permissions on storage and bootstrap/cache, a certificate, a database. Each item on its own is simple, but together it is an evening of work, plus another evening figuring out why the page returns a blank screen.

Netrun removes that part entirely: you upload your code, the platform sees for itself that this is a PHP project, installs the dependencies, builds it and issues a public HTTPS link. Below is what to prepare in the project so it works the first time.

  1. Check that composer.json is in the root

    The composer.json file in the project root lists dependencies and tells the platform this is a PHP project on Laravel. Do not include the vendor folder in the archive — we install the libraries ourselves from composer.json during the build, and the extra megabytes only slow the upload down.

  2. Keep the .env file out of the archive

    The .env holds your app key, passwords and access to external services, so it must not end up in the archive or the repository. Enter all of its values — the app key, the environment, database and mail credentials — during project setup: they go into environment variables encrypted, and Laravel reads them the usual way.

  3. Turn debug mode off

    Before publishing, switch the app into production mode: debug off, environment set to production. Otherwise the very first error shows a visitor a detailed page with pieces of your code and settings. These values are set through the same environment variables during project setup.

  4. Decide where the database will live

    If your site uses a database, you can run one next to it in the same project: describe the app and the database in a docker-compose file, up to five connected services. Be sure to attach a named volume to the database, otherwise the data is wiped on the very first code update. Migrations are easiest to run on app startup — then the tables are created for you.

  5. Upload the code and grab the link

    Upload the project as a ZIP archive or import a repository from GitHub, including a private one. Netrun installs the dependencies, builds the project and starts it — there is no need to configure nginx, php-fpm or the public folder root by hand. Build and startup logs are visible in your dashboard in real time, and after publishing you get an HTTPS link.

The result: your Laravel site opens at its own address over a secure connection, without renting a server, configuring a web server by hand or fiddling with a certificate. On the free plan the site sleeps when idle and wakes up when the link is opened — the first response after a pause is a little slower; on Pro there is no idle downtime and you can attach your own domain. Try Netrun.

Common questions

Do I need to configure nginx and php-fpm?

No. The web server, php-fpm and the root in the public folder are configured automatically during the build. All we need from you is the project code with a composer.json.

What do I do with the .env file?

Do not put it in the archive or the repository. Enter its values during project setup — they go into environment variables encrypted, and Laravel reads them the usual way through config and env.

How do I handle the database and migrations?

You can run a database next to the app in the same project through a docker-compose file — up to five connected services. The database must have a named volume, otherwise the data disappears on a code update. Migrations are easiest to run on app startup, so the tables are created on the first publish.

What about files uploaded by users?

Files the app writes into the storage folder live inside the container and are recreated on a code update. If uploads have to persist, keep them in external file storage or attach permanent storage to that folder.

Will the site fall asleep?

On the free plan, yes: if the site is not used for a while it sleeps and wakes up when someone opens the link, so the first response after a pause is a little slower. On the Pro plan the site runs without idle downtime.

Can I run several services at once?

Yes. With docker-compose you can bring up to five connected services in one project — for example, an app together with a database.

Where do I set tokens and other secret values?

In the project settings there is a section for values from your code — for example, the token from BotFather. We store them encrypted.

Can I connect my own domain?

Yes, on the Pro plan, and not just one: you can connect as many of your own domains to a website as you need. Open the “Domains” tab on the project page, enter the domain you bought from a registrar, and add the DNS record shown in the hint — every next domain is added the same way. Once the domains are ready, press “Check”: Netrun checks them all at once and issues a separate HTTPS certificate for each, so a hiccup with one domain does not hold up the others. The site opens at any of your addresses, and the Netrun link stays as a backup. If you connect a whole domain (for example myshop.com), you can add one more record so the site also opens with www. This is for websites — a bot or a background script does not need a domain.