Created
February 23, 2021 16:32
-
-
Save Braunson/639a1ab0c1839643d95345c6d7b0f92f to your computer and use it in GitHub Desktop.
Install MeiliSearch in Laravel Homestead. Don't forget to port forward 7700 -> 7700 to be able to access the MeiliScript UI
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "Downloading MeiliSearch" | |
# | |
# Install MeiliSearch | |
# https://docs.meilisearch.com/create/how_to/running_production.html#step-2-run-meilisearch-as-a-service | |
# | |
# Update the list of available packages and their versions | |
sudo apt update | |
# Install curl which is required to install MeiliSearch in the next step | |
sudo apt install curl -y | |
# Install MeiliSearch latest version from the script | |
sudo curl -L https://install.meilisearch.com | sh | |
# Move MeiliSearch to the user bin | |
sudo mv ./meilisearch /usr/bin/ | |
# Create the service | |
sudo cat << EOF > $(pwd)/meilisearch.service | |
[Unit] | |
Description=MeiliSearch | |
After=systemd-user-sessions.service | |
[Service] | |
Type=simple | |
ExecStart=/usr/bin/meilisearch --http-addr 0.0.0.0:7700 --env=development --no-analytics=true --master-key homestead | |
[Install] | |
WantedBy=multi-user.target | |
EOF | |
# Move the service to your the system folder | |
sudo mv $(pwd)/meilisearch.service /etc/systemd/system/meilisearch.service | |
# Set the service meilisearch | |
sudo systemctl enable meilisearch | |
# Start the meilisearch service | |
sudo systemctl start meilisearch | |
# Reload the operating system daemons / services | |
sudo systemctl daemon-reload |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment