• Stars
    star
    580
  • Rank 77,010 (Top 2 %)
  • Language
    Shell
  • Created over 6 years ago
  • Updated 7 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

LaraSail - Set Sail with your Laravel app on DigitalOcean

LaraSail

LaraSail is a CLI tool for Laravel to help you sail the servers of the DigitalOcean.


You'll need a DigitalOcean account before getting started (Signup here), then you'll need to create a New Droplet. Make sure to select Ubuntu Server:

Installation

SSH into your server and run the following command:

curl -sL https://github.com/thedevdojo/larasail/archive/master.tar.gz | tar xz && source larasail-master/install

You can make sure it's installed by running:

larasail -h

Setup your server

larasail setup

The default configuration will install Nginx, PHP 8.1, and MySQL 8. If you wish to use PHP 7.1, 7.2, 7.3, 7.4, 8.1 or 8.2 you can include the argument php71/php72/php73/php74/php80/php82 like so:

larasail setup php71 # Install with PHP 7.1
larasail setup php72 # Install with PHP 7.2
larasail setup php73 # Install with PHP 7.3
larasail setup php74 # Install with PHP 7.4
larasail setup php81 # Install with PHP 8.0
larasail setup php82 # Install with PHP 8.2

Database

By default, LaraSail will set up the latest version of MySQL. To opt for MariaDB instead, kindly pass mariadb to larasail setup as the second or third parameter like so:

larasail setup mariadb # will install default PHP version (7.4) and MariaDB
larasail setup php80 mariadb # will install the selected PHP version (8.0 in this case) and MariaDB
larasail setup mariadb php80 # same as above

Redis

By default, LaraSail does not install a Redis server. To opt to install redis, pass redis option to larasail setup as the second or third parameter like so:

larasail setup php80 redis

or

larasail setup redis

Creating a new site

✨ Automatically

Laravel

After setting up the server you can create a new project by running:

larasail new <project-name> [--jet <livewire|inertia>] [--teams] [--www-alias]

This will automatically create a project folder in /var/www and set up a host if the provided project name contains periods (they will be replaced with underscores for the directory name). By default, LaraSail sets up the Nginx site configuration and Let’s Encrypt SSL certificate for your domain. If you would like both the www alias and root domain setup (i.e. example.com and www.example.com) kindly pass the --www-alias flag.

Wave

Wave - The Software as a Service Starter Kit, designed to help you build the SAAS of your dreams. 🚀 💰 LaraSail allows you to create a new Wave project automatically by adding --wave flag to the new command as follows:

larasail new <project-name> [--wave]

Just like Laravel above, this will create a project folder, setup the Nginx site configuration and Let’s Encrypt SSL certificate for your domain. By default, you will be prompted to create a project database and if successful, will migrate and seed the database.

🚧 Manually

Alternatively, you can clone a repository or create a new Laravel app within the /var/www folder:

cd /var/www && laravel new mywebsite

If you want to include Laravel Jetstream into your project, you need to specify the --jet option:

cd /var/www && laravel new mywebsite --jet

Then, you'll need to setup a new Nginx host by running:

larasail host mywebsite.com /var/www/mywebsite --www-alias

larasail host accepts three parameters:

  1. Your website domain (mywebsite.com)
  2. The location of the files for your site (/var/www/mywebsite/public)
  3. Optional flag if you would like to include your project's www alias: www.mywebsite.com (--www-alias)

Finally, point your domain to the IP address of your new server. And wallah, you're ready to rock 🤘 with your new Laravel website. If you used the --www-alias flag, don't forget to add your domain's www CNAME record

Passwords

When installing and setting up LaraSail there are two passwords that are randomly generated:

  1. The password for the larasail user created
  2. The default MySQL password

To get the larasail user password you can type in the following command:

larasail pass

And the password for the larasail user will be displayed. Next, to get the default MySQL root password you can type the following command:

larasail mysqlpass

And the MySQL root password will be displayed.

Creating a database

After you have created your project you can create a database and user for it by using the following command:

larasail database init [--user larasail] [--db larasail] [--force]

By default it will create a database and the user larasail and grant all permissions to that user.

TIP: If you are in the project directory when you run this command, it will also try to update the .env file with the newly generated credentials.

After you have created a database, you can show the newly generated passwords using the following command:

larasail database pass

Switching to the larasail user

When you SSH into your server you may want to switch users back to the larasail user, you can do so with the following command:

su - larasail

Make sure to star this repository and watch it for future updates. Thanks for checking out LaraSail. ⛵

Contributing

If you are contributing, please read the contributing file before submitting your pull requests.

More Repositories

1

voyager

Voyager - The Missing Laravel Admin
PHP
11,767
star
2

wave

Wave - The Software as a Service Starter Kit, designed to help you build the SAAS of your dreams 🚀 💰
PHP
5,105
star
3

pines

The Pines UI library
HTML
2,562
star
4

chatter

Chatter is a Simple Laravel Forum Package
PHP
900
star
5

genesis

An Application Starter Kit - Built with Laravel Folio and Volt
Blade
770
star
6

tails-components

The Tails Open Source Components are a (no-config) copy'n paste free collection of hand-crafted templates and components built in TailwindCSS.
HTML
760
star
7

static

⚡️ The ultimate static site generator. Tailor-made for killer blogs, sizzling SaaS landings, audacious personal sites, and every web fantasy you dare to dream up.
JavaScript
128
star
8

php-login-script

This is a simple PHP login script using PHP, PDO, and MySQL
PHP
97
star
9

tailwind-breakpoint-tool

A simple breakpoint tool for develping your TailwindCSS sites.
JavaScript
91
star
10

voyager-themes

Theme Hook for Voyager
PHP
82
star
11

create-alpine-app

A simple starter template for your Alpine and Tailwind projects
HTML
56
star
12

voyager-polls

Create Interactive Polls with this hook for Voyager
Vue
47
star
13

laravel-user-image

Repo for episode tutorial on adding a user profile photo -
PHP
43
star
14

tails

This is the Tails composer package for Laravel. Easily fetch designs in your Laravel application that you design inside of the Tails Site/Page Builder.
PHP
35
star
15

create-a-php-routing-system

This repo is the code used in the DevDojo Creating a PHP Routing System Video Series
PHP
33
star
16

laravel-reactions

A Laravel Reactions Package
PHP
32
star
17

voyager-redirects

A Hook that allows you to add redirects to your Laravel and Voyager App
PHP
32
star
18

voyager-site

This is the source for LaravelVoyager.com website
HTML
26
star
19

voyager-installer

This is the repo for the Voyager installer
PHP
25
star
20

wordpress-import

This is a hook for Voyager that will import a Wordpress xml file into the Voyager DB
PHP
24
star
21

image-uploads-with-laravel-and-filepond

This is the source code for the video 'Image Uploads with Laravel and Filepond'
PHP
18
star
22

website-screenshot-with-laravel

Learn how to create a screenshot of a website with Laravel
PHP
16
star
23

themes

A package to add themes functionality in your Laravel application (Currently for Voyager)
PHP
14
star
24

livewire-trix-editor-post

This is a repository for the trix editor post written on the DevDojo
PHP
13
star
25

htmlinclude

A simple script allowing you to include html files inside of html
JavaScript
13
star
26

google-image-search

Google Image Search PHP Package
PHP
12
star
27

wordsmith-ui

The UI for the Wordsmith CMS built using the Tallstack
HTML
7
star
28

html5-platform-game

An HTML5 Platform Game created for https://devdojo.com/course/html5-platform-game
JavaScript
7
star
29

pages

This is one of the default themes for the Voyager Themes Hook
JavaScript
6
star
30

dribbble

Dribbble API Package for Laravel
PHP
5
star
31

behance

Behance API Package for Laravel 4
PHP
5
star
32

sample-theme

This is a very basic sample theme for Voyager Themes Hook
HTML
5
star
33

blog

The DevDojo Blog Power-up
Blade
4
star
34

laravel-socialite-tutorial

Laravel Socialite Tutorial
PHP
4
star
35

laravel-wave-api-endpoints

Endpoints for Wave API
4
star
36

welcome

A simple welcome package
PHP
4
star
37

mochi

Mochi Mini Framework
PHP
3
star
38

devblog

Developer Blogging Platform
JavaScript
3
star
39

create-a-php-singleton-class

This is the source code creating in the video 'The PHP Singleton Class'
PHP
3
star
40

forrst

A Forrst API Wrapper Package for Laravel 4
PHP
3
star
41

ninjamediascript

Ninja Media Script Documentation
JavaScript
3
star
42

blockjs

The BlockJS Editor
JavaScript
2
star
43

static-starter

The starter template for Static
HTML
2
star
44

devcoin

This is the repo for stored assets for the DevCoin
2
star
45

slider

A TailwindCSS Slider with multiple flavors including React, Vue, Alpine, and VanillaJS
JavaScript
2
star
46

blockjs-website

Website for BlockJS
CSS
2
star
47

app

This is the repo for the DevDojo products application package
PHP
2
star
48

.github

The Dev Community where we can all create, learn, and grow together.
1
star
49

laravel-deployer-cloudways

This is the repo for the Laravel Deployer Cloudways video
PHP
1
star
50

components

Components for your Laravel applications powered by Volt
Blade
1
star
51

devdojo

The DevDojo NPM CLI
1
star
52

Ninja-Media-Script-Theme-Default

Ninja Media Script Theme - Default
PHP
1
star
53

static.devdojo.com

The repo for the main static website
HTML
1
star