# How do I deploy my Laravel project?

https://www.seturack.com/en/knowledgebase/article/how-do-i-deploy-my-laravel-project

1. In the panel, open **My servers** and click your server.
2. On the **Overview** tab, wait for the **App** row to say "Laravel is ready". The page refreshes itself.
3. Open the link in the **Site address** row. You see the Laravel welcome page.

## Bringing your own code

[Connect over SSH](https://www.seturack.com/en/knowledgebase/article/how-to-connect-with-ssh) and switch to the project user:

`su - app`

`cd /var/www/laravel`

The project lives here. After copying your own code in, run:

`composer install --no-dev`

`php artisan migrate --force`

`php artisan config:cache`

The `.env` file is ready, so do not overwrite it. The database name and user are both `laravel`, and the password is in the panel.

## What comes ready

- The queue worker is the `laravel-kuyruk` service. Run `systemctl restart laravel-kuyruk` when your code changes.
- The scheduler runs every minute (`/etc/cron.d/laravel`).

## Your own domain

1. Point your domain's A record to your server's IP address.
2. As root, replace the old name everywhere: `sed -i 's/OLD_NAME/yourdomain.com/g' /etc/caddy/Caddyfile`. `OLD_NAME` is the part after `https://` in the address shown in the panel.
3. Run `systemctl reload caddy`.

Caddy gets and renews the certificate by itself.

Also update `APP_URL` in the `.env` file. Only **80**, **443** and **22** for SSH are open to the outside.

**No server yet?** [Order a server with Laravel installed](https://www.seturack.com/en/laravel-vps): you choose the size and pay for what you choose.
