NewExtra server protection with Measured Boot & UKI images.View Measured Boot
BlogDocumentationFAQNo Third-Party CookiesContact Us
  • Pricing
Log inSign up
Cloud VPSVDSMemory-Optimized VDSStorage-Optimized VDSWindows VPSBitcoin VPSDDoS ProtectionPrivate Networking (VPC)Floating IPsAdditional Server SupportMicrosoft LicensesDatacenterNetworkDocumentationFAQNo Third-Party CookiesConfidential ComputingSelf-Hosted VPNBlogAboutBrand GuidelinesAffiliatesContact UsLegal & Compliance

Products

  • Pricing
  • Cloud VPS
  • VDS
  • RAM-Optimized VDS
  • Storage-Optimized VDS
  • Windows VPS
  • Bitcoin VPS
  • DDoS Protection
  • Private Networking (VPC)
  • Floating IPs
  • Microsoft Licenses
  • Additional Server Support

Explore

  • Documentation
  • Developers API Docs
  • FAQ
  • Datacenter
  • Network
  • Looking Glass
  • Confidential Computing
  • Cookie Policy
  • Self-Hosted VPN

Company

  • Blog
  • Contact Us
  • About Us
  • Brand Guidelines
  • Affiliates

Legal & Compliance

  • Terms of Service
  • Privacy Policy
  • Data Processing Agreement
  • Acceptable Use Policy
  • Microsoft Software Terms of Use
  • Refund Policy
  • Report Abuse

Products

  • Cloud VPS
  • VDS
  • RAM-Optimized VDS
  • Storage-Optimized VDS
  • Windows VPS
  • Bitcoin VPS
  • DDoS Protection
  • Private Networking (VPC)
  • Floating IPs
  • Microsoft Licenses
  • Additional Server Support
Pricing

Explore

  • Documentation
  • Developers API Docs
  • FAQ
  • Datacenter
  • Network
  • Looking Glass
  • Confidential Computing
  • Cookie Policy
  • Self-Hosted VPN

Company

  • Blog
  • Contact Us
  • About Us
  • Brand Guidelines
  • Affiliates

Legal & Compliance

  • Terms of Service
  • Privacy Policy
  • Data Processing Agreement
  • Acceptable Use Policy
  • Microsoft Software Terms of Use
  • Refund Policy
  • Report Abuse

© VPS.BG Ltd. 2026 · All rights reserved!

Made with passion in Bulgaria · VAT ID: BG203144520

Contents

  • Transfer the project files to the server
  • Generate a new application key
  • Install any dependencies
  • Further Laravel configurations
  • Connect to a database

Subscribe to Our Newsletter

Join 5000+ subscribers and receive helpful content, deals and more! We promise no spam - 100% great content. Unsubscribe anytime.

Share Article

#Tutorial
  1. Documentation
  2. /
  3. #Tutorial
  4. /
  5. How to upload a Laravel project to a VPS

How to upload a Laravel project to a VPS

Published: 03 January 2024 • 3 min read

#Tutorial#Laravel

In this tutorial we are going to be delving deeper in the nature of Laravel in order to show you how to manually upload your project to your Laravel VPS server. Alternatively, you can also use Laravel Forge in order to automate the process.

Transfer the project files to the server

Before configuring anything, you will first need to securely transfer all of your Laravel project files from your local environment to the cloud server. You can do this by using either SFTP or FTP. SFTP is the more secure option but you will also need to have root access to your server with either a root password or active SSH keys set up.

We recommend the SFTP option as it is far more secure and you probably already have SSH access to your server. Some popular clients that are widely used and support both SFTP and FTP include FileZilla and CyberDuck. Just make sure you have your credentials like the hostname, password and your server’s IP address as you will need them in order to connect through SFTP. You can always contact your provider if you don’t know any of the aforementioned data.

IMPORTANT: Make sure to keep the same project directory structure so that you can avoid any configuration issues!

Generate a new application key

Once you finish transferring the files, you will need to generate a new application key which consists of 32 randomized characters for your Laravel project. The key is used for encryption and authentication, which will protect your data from anyone that tries to access your information. This mechanism is particularly useful for protecting any data which will be collected, stored and utilized by your project. Generating a new key ensures that any data encrypted in your application is secured with a key that has not been exposed or potentially compromised in any other environment.

To generate a new key you will need to open up the terminal and go to the root directory of your Laravel project. Next, run the following command:

php artisan key:generate

This command automatically generates a new application key and updates the APP_KEY value in your project's .env file. After the key has been generated and the .env file updated, it is recommended to restart your Laravel application to ensure the new key will be used.

Install any dependencies

Next, you will also need to install all required project dependencies such as libraries and frameworks in order for your application to work fully. You can install everything by navigating to your project’s directory where your composer.json file is stored and using the following command:

composer install

To make sure everything is up to date, you can also run this command:

composer update

It is generally advisable to run this command in a staging environment and if everything works fine, then you can proceed with upgrading the production environment.

Further Laravel configurations

You can now finally proceed to configuring Laravel. You will need to set environment variables, application secrets, API keys and you will also need to establish a database connection. Additionally, you will also have to create a symbolic link between your project’s public folder and your server’s root directory, which will allow the server to actually access and serve static files from your application.

Connect to a database

In order for your project to work, you will need to connect to your database and set up a database user (and don’t forget to set the correct permissions) as well as the required tables. You will then need to migrate your data from your local environment to the new database. Depending on your local database, this could be accomplished in various ways, for example with the tools mysqldump and mysqlrestore for MySQL databases or pg_dump for PostgreSQL.

Subscribe to Our Newsletter

Join 5000+ subscribers and receive helpful content, deals and more! We promise no spam - 100% great content. Unsubscribe anytime.

Share Article

Related Content

20 February 2024

What are Nextcloud Trusted Domains & How to Add Them

Learn more about Nextcloud’s trusted domains in addition to how to add them to your Nextcloud and what to look out for when doing so!

#Tutorial#NextCloud
26 February 2023

How to manage a VPSBG cloud server with Docker

In this documentation entry you are going to learn how to manage your Docker cloud server. You can also have a look at the installation script.

#Tutorial#Docker
30 November 2023

How to operate your CyberPanel cloud server

Learn how to manage your CyberPanel cloud server including changing your password and updating the software as well as creating a main and subdomain.

#Tutorial#CyberPanel
26 February 2023

How to manage a VPSBG cloud server with WireGuard VPN

In this tutorial you are going to learn how to manage a cloud server with WireGuard VPN including how to connect and manage your user profiles.

#Tutorial#WireGuard

Privacy-First, App-Ready Cloud Servers

Deploy a powerful and secure cloud VPS server with a popular pre-installed application with a single click!

Deploy App TemplateContact Us