Shreyansh Panchal
Shreyansh Panchal

Reputation: 937

Redis does not start on boot on homestead vagrant server

I know that we can directly ssh into the VM & enable the redis service. But i think there must be a way to enable redis using homestead.yaml. I tried to search for docs but i couldn't find anything.

EDIT

I'm posting my homestead.yaml file.

ip: "192.168.10.10"
memory: 1048
cpus: 2
provider: virtualbox

authorize: C:\Users\stack\.ssh\id_rsa.pub

keys:
    - C:\Users\stack\.ssh\id_rsa

folders:
    - map: W:\sites\project
      to: /home/vagrant/project

sites:
    - map: project.test
      to: /home/vagrant/project/public

databases:
    - homestead

features:
    - mariadb: false
    - ohmyzsh: false
    - webdriver: false

I have installed predis so the connection with redis is not an issue. Everytime i boot my vm, I manually have to go & start redis by typing this command systemctl start redis-server.

Which is the reason i was wondering that there must be a way to enable redis server from inside the homestead.yaml so i don't have to do it manually.

Upvotes: 1

Views: 3078

Answers (4)

Alexandr Tsyganok
Alexandr Tsyganok

Reputation: 369

Try adding services section to your homestead.yaml after features section, but I don't know if order matters.

services:
- enabled:
      - "redis-server"

Then vagrant reload --provision

Upvotes: 0

Tarek Adam
Tarek Adam

Reputation: 3535

If you want homestead's redis server to start automatically whenever homestead is up...

  1. Log into homestead via ssh.
  2. sudo systemctl enable redis-server

You should only need to run this once.

Upvotes: 5

senty
senty

Reputation: 12857

Redis is already included/installed thus enabled in Homestead. See included softwares of Homestead.

To test type redis-cli and ping in your command line (inside vagrant)

For predis just run composer require predis/predis.

Upvotes: 1

Shreyansh Panchal
Shreyansh Panchal

Reputation: 937

There was a Bug with this version of Homestead 10.0.1

Redis does not start on boot.

However this has been fixed if you check out the issue i have linked.


Still an issue?

Here is a quick fix while waiting for homestead box update

sudo service redis-server start

Upvotes: 1

Related Questions