By sanjeevsetu
I am able to setup my LAMP inside droplet but not able to find the docs to setup Laravel Spark. Can anyone guide me???
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi there,
I would usually stick to LEMP, there is a nice community tool that does all of the server setup and Laravel installation for you with a couple of commands:
https://www.digitalocean.com/community/tools/larasail
It is very well documented and it pulls up the latest Laravel version for you.
Once you have the Laravel application installed, you can follow the steps here on how to add the Laravel Spark Package and include the API Key:
https://spark.laravel.com/docs/1.x/installation.html
Alternatively, if you prefer LAMP, you could install Laravel by following the steps here:
https://devdojo.com/bobbyiliev/laravel-app-on-digital-ocean-ubuntu-1904-droplet-step-by-step-guide
Hope that this helps. Regards, Bobby
Setting up Laravel Spark on a LAMP stack involves several steps. Laravel Spark is a premium package that adds subscription billing features to your Laravel application. Here’s how you can set it up from scratch on your LAMP stack:
Before installing Laravel Spark, ensure the following are installed on your LAMP stack:
PHP (8.0 or later preferred):
bash Copy code
php -v
Ensure extensions like pdo, openssl, mbstring, tokenizer, json, xml, and bcmath are installed.
Install missing extensions (if necessary):
bash Copy code
sudo apt install php-mbstring php-xml php-bcmath php-curl
Composer: Laravel Spark requires Composer for managing dependencies.
bash Copy code
composer --version
Install Composer if not already installed:
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
MySQL/MariaDB: Ensure your database is set up and a database is created for Laravel Spark.
Laravel Installer: Install the Laravel installer globally (optional but helpful):
composer global require laravel/installer
sudo apt install nodejs npm
sudo a2enmod rewrite
sudo systemctl restart apache2
Laravel Spark is a commercial package available at Laravel Spark. Purchase a license and download the Spark installer.
Create a new Laravel project for Spark:
laravel new my-spark-app
# OR using Composer
composer create-project --prefer-dist laravel/laravel my-spark-app
Navigate to the project directory:
cd my-spark-app
Install Laravel Spark using the Spark installer or Composer:
Download and install Spark into your Laravel app:
php artisan spark:install
Alternatively, if you’ve been provided a Composer package for Spark:
composer require laravel/spark-audio
# Replace "audio" with your purchased edition if applicable.
Run Spark’s installation script:
php artisan spark:install
Update the .env file to set up the database and environment:
APP_NAME="Laravel Spark App"
APP_ENV=local
APP_KEY=base64:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
APP_DEBUG=true
APP_URL=http://yourdomain.com
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=spark_database
DB_USERNAME=spark_user
DB_PASSWORD=spark_password
Migrate the database to set up Spark’s tables:
php artisan migrate
Install Node.js dependencies and build assets:
npm install npm run dev
For production:
npm run prod
Ensure the storage and bootstrap cache directories are writable:
sudo chown -R www-data:www-data /path/to/my-spark-app
sudo chmod -R 775 /path/to/my-spark-app/storage /path/to/my-spark-app/bootstrap/cache
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.