Local Wordpress Development on M1 Macbook with 10up WP Local Docker 10updocker

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
i was about to install a tool that i used very often for wordpress development and i thought this would be a great opportunity for me to share with you how to use this tool the installation is super simple first you need to have docker desktop installed and running because this utility is is going to use the docker it's going to use the docker engine to set everything up for you with docker compose files and you don't need to know docker in order to use this tool it's going to do everything for you so you can focus on the development this isn't the only one then up docker is not the only one there's also ddef and orlando lando i don't believe is still available for the m1 mac now 10 up docker is super useful for all systems it is compatible in windows mac and linux i use it in linux a lot and i love it however on the m1 mac you're going to have to do a little trick at the very end in order to get it running a little bit quicker but we don't have to worry about that for now so let's just open up the browser and just type 10 up docker all right so this is the repo for 10 up docker um just go to the installation steps it's basically an npm command so you're gonna run npm install g for global wp local docker now i need to tell you this i have had errors installing this utility with node version 15 and node version 16. i don't know why it only works really well with the node 14. so with nvm which i showed you how to install in one of my older videos if i type no dash v ooh dash v sorry i'm going to be using node 14 to install it i don't know why whenever i use a newer version of node it fails oh i believe i already have it copied paste now remember i'm using node 14 if you have nvm the node version manager install you can easily switch versions but this is the version that works best oh and it also for linux even though i'm using linux which is an ax x86 architecture i am still having issues installing it with newer versions of node so you need to use 14. um this utility is super awesome because it sets up the it sets up a couple of containers sets up my sequel php my admin php fpm engine x male catcher and a dns it sets all of those containers up for you and you don't even have to know docker all right so it looks like it's about to install we need to use our sudo password awesome it appears it finally installed now it took 5 minutes and 18 seconds to install i don't know what's going on when i first started using this utility about a year ago i was able to install this within a minute or two so i don't know why it's taking five minutes it's also taking this long on linux as well in my other laptop regardless it's installed and let's just clear everything out of the way now this utility helps you initialize wordpress from scratch on your local machine so you can start development but it also helps you set up existing websites all you have to do is clone the database and you should be golden so if we do well uh docker ps you can see we have no containers running if we do ls you should be able to see this directory wp dash local docker slash sites this is where all of your websites that you set up with 10 up docker are going to live now we do need to make a couple of changes for the m1 mac if you're on linux or windows don't worry about this step just skip ahead if we do dash ls dash a we can see there's also another folder associated with 10updocker dot wp local docker so if we see the into wp local docker we do ls cd into global at ls you can see a docker compose file so we're going to open that with nano and you're going to go down this is only if you're on an m1 mac by the way you need to column multi-arch i believe that is what we need to do and then we need to change my sequel for mariadb now mariadb is a fork of my sequel before the guy sold it but mariadb has an arm version which my sequel does not so it's a drop it mariadb is a drop in replacement and it works great um yeah i believe that's all we needed to do now for that we need to hit ctrl o enter and then control x awesome so now let's go back home now if you wanted to make a website once you had the docker compose file changes all you need to do is turn up docker create and then the name of the site in this case we're going to do code fallacy now it's going to ask you what's the hostname usually 10 up docker uses the task convention so we're going to do code fallacy dot test are there any additional domains that your your site should respond to no just one domain here we can use the or we can select the php version we want to use 7.4 yes we would like to end up docker to download and install the wordpress yes you are able to set up a single site subdirectory multi site multi-site and core development version the only tool i use is subdomain multi-site before but that was for a client and single site we're just going to do single site site name we can leave it as default admin username admin is fine and then password is going to be password admin email we're going to leave it as default do you want to remove the default content no we want to initialize the site and have at least one thing which is the hello world blog post and here's another cool thing you can this will set a proxy for you if you wanted to so you don't have to download the uploads folder in wordpress which contains all the media the images the videos you know that that that directory that folder can get really heavy really quick depending on the size of your site so what you can do is you can set up a proxy if the site is deployed if you're recreating a deploy site so that every time an image is requested it goes and gets it from the original site however because we're not setting up a live site no would be great because you know this is going to be a site from scratch um do you need elasticsearch no no we do not and here is where the magic happens it will do this all by itself it will set up all the containers and like i said the only two things you had to do was change the my sequel image in the docker compose file to mariadb and add the multi-arch to the 10 up what was it the 10 up dns i think i don't know oh global services are running setting up my sequel that's great the database has been created and initialized and it's starting to turn up docker containers for this website and the great thing about this utility is that once you have it set up you can easily spin many sites and have them all be independent of one another now because this sets up mariadb you can either access it through phpmyadmin or you can do something cooler which is use sql pro and we're gonna use sql pro alright now remember this is the m1 macbook so it needs to translate a bunch of things from x86 to arm and then run them even though this is a very powerful um you know cpu in terms of what it can do it still takes a bit of time now if you see here these are all the images the 10 up docker has spun up and all the ones with this tag are basically x86 architecture that needs that needs to use rosetta now we're not going to use phpmyadmin but i do need to show you something if you decide not to use another sql manager and you wanted to go to phpmyadmin you need to go to localhost ah oops forgot what it was already so php is 80.92 so if you decide not to use another um database client or sql client in order to access the database of the site you can go to localhost 8092 and it will bring up phpmyadmin the username is just root this is something they don't really tell you and that's why i'm showing it to you and the password is password don't save and as you can see it set the database up globally but it also sets up our specific tables for our website uh if you go to code fallacy test okay so the reason i asked me for a password is not because of php in my admin but because it's right it's trying to write to the host file so yes we're going to we're going to give it access so now we have this local domain codefallacy.test that we can visit and it will take us to our wordpress install which is awesome we have this everything is working oh i think i need to do http not https oh no it's not working see this is the issue i have with the m1 macbook um even though all the containers are clearly running something else needs to be done what i'm going to do is i'm going to disable phpmyadmin and global mail catchers as i don't use those and those are both taking up significant resources because they need to be translated in order for you to stop all the containers the command is 10 out docker stop all and it will stop every single container don't use the docker desktop just run it on the terminal and use 10 up docker so what i'm going to do is do i have the code command yes so i do have vs code all right so we're gonna cd into the sorry sorry sorry dot wp local docker cd into global and we're going to open up the s code here so i never been able to run any of this with ssl certificates but we don't care about that we just care about this file right here we're going to comment out phpmyadmin as we don't really need it and mailcatcher let me double check multi arch yes maria db yes and the dns okay so i believe that's it so we're going to hit commands command s to save it and let's try it again right let's go back to home cd into the wp slash local docker files or the local docker sites and here's our site so we can cd into that directory and then just type 10 up docker start now that error occur mostly because it takes forever to run all those containers with rosetta and now that the resources have been freed up we're able to access the site now that only happens on the m1 macbook if you if you leave all of those containers running you're definitely going to run into errors if we go back to the dashboard you can now see that we have two less containers running but those containers were using rosetta which were taking a lot of resources and throwing errors now now that you have the site installed this is just your basic wordpress theme if you wanted to log into the admin dashboard you go dash admin sorry slash wp admin now because you're going into a site that is requiring you to enter login credentials you're going to be told hey you know this doesn't have an ssl certificate but don't worry this is running locally so don't worry just accept the risk and continue and the default username is admin and the password is password and i know that doesn't seem secure but this is just for local development you can't access this site outside of this computer right now and just like that we have access to the dashboard we can create a post we can manage the media we can manage pages and it is reasonably fast but it's not the quickest right in linux when i run a local wordpress install it is a lot quicker but remember the m1 mac is running docker and then that docker is running containers that are not optimized for arm yet so if we go here let's see the site once again so if you wanted to start learning wordpress this was a great opportunity like for example this is the theme but you can go here and click activate this theme and we're gonna use this theme now if you refresh the page boom brand new theme content remains the same if you wanted to change your blog post you can come here let's add a new post oh this is using gutenberg already nice so for title we're just gonna type code fallacy it's okay he's not he doesn't rock he's just okay and then here we're just gonna type this is a test paragraph and we're going to publish it yep publish and if we refresh here in the home page boom we now have a new blog post now 10 up docker is awesome in the sense that not only does it set everything up for you so you don't have to worry about whether things are being forwarded through the right ports locally and a bunch of other nonsense right but you also have access to the wp [Music] cli tool in order to use it all you have to do is type 10 up docker and then wp and now you have access to the wp cli so if you wanted to search for example for a domain i mean we just created wp db search code fallacy you know this wp tool is super powerful and look it will tell you where it found code fallacy so a very versatile tool um i used it a lot for work and i thought it was a great idea to showcase it to you guys as to you know if you want to do wordpress development on the m1 mac now like i said even though the m1 processor is super powerful because some of the docker containers are running through emulation is not the quickest thing in the world now you have services that are global and you have services that are specific to your site so if you were to create another site these will run again and you'll be able to see the databases for this site and other sites but remember you know you have your global and then you have your site specific containers and if you want to stop them all you can stop them here but it's more advisable to come to the terminal and just type 10 up docker stop all and just like that it killed every single process i know this was kind of a long video but this utility is super awesome if you have any questions drop them down in the comments and i'll help you out if i can
Info
Channel: Code Fallacy
Views: 347
Rating: undefined out of 5
Keywords: wordpress, m1, m1 pro, m1 maxx, wordpress development, apple silicon, docker, m1 macbook air, macbook, install, 10up, 10updocker, lando, ddev, local wp, wp local docker
Id: qIviuna4nnA
Channel Id: undefined
Length: 20min 47sec (1247 seconds)
Published: Mon Nov 01 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.