Mahdyar's Blog

My Thoughts

Laravel on Apple Silicon (M1 arm64)

If you have an M1 Mac and want to install Laravel on Apple Silicon, you’ve probably encountered some difficulties with Laravel…

As Laravel Documentation suggests, you should use Docker, but well.., Docker is not yet fully supported on M1 macs, however, you can download the preview build from here. it works just fine.

But even having Docker installed isn’t enough, because Laravel uses MySQL and MySQL doesn’t have an arm64 image. so what’s the solution?

In particular, the MySQL image is not available for ARM64. You can work around this issue by using a MariaDB image.

https://docs.docker.com/docker-for-mac/apple-m1/

fine, but how? well it’s much easier than what I thought, if you try to run

./sail up

You’ll receive an error like this one:

laravel ERROR: no matching manifest for linux/arm64/v8 in the manifest list entries

you can simply edit “docker-compose.yml” in root of your project:

...
    mysql:
        image: 'mysql:8.0'
...

and just change MySQL to MariaDB:

...
    mysql:
        image: 'mariadb:10.5.8'
...

That fixed the problem of running “Laravel on Apple Silicon” for me! Have fun and Let me know in the comments if there’s something wrong. 🙂