Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

successdav's avatar

Run artisan commands on production server

I AM NEWBIE WITH SERVER MANAGEMENT, PLEASE BE EXPLICIT WITH YOUR ANSWERS, SO I CAN EASILY UNDERSTAND. THANK YOU

I have ssh into my server from console

Welcome to Ubuntu 18.04.2 LTS (GNU/Linux 4.15.0-54-generic x86_64)

I want to clear cache by

php artisan cache:clear

but when I run this it says. command not found and when I run vagrant ssh, it says vagrant not found but can be installed.

0 likes
3 replies
Ty's avatar

Have you installed Composer, or Laravel on this server? PLEASE BE EXPLICIT WITH YOUR ANSWERS, SO I CAN EASILY UNDERSTAND. THANK YOU

rawilk's avatar
rawilk
Best Answer
Level 47

You have to navigate to the directory where your project is on the server, and then run the commands you need to.

Example:

cd /home/myusername/my-project-url.com
php artisan cache:clear
1 like

Please or to participate in this conversation.