How to configure your local Env when you don’t have your own server

This tutorial will explain to you how to setup your local env for a great development environment following the dvk dev community best practices. We are going to explain to you how to setup VirtualBox for WordPress dev on your machine.

DISCLAIMER: this is a local env tutorial, do not use these elements for production env

Prerequisite:

  • Windows 10
  • Providing your email to your project manager
  • Providing your GitHub username to your project manager

To access the project files & db please refer to that article.

Install VirtualBox and our OVA file

First, you’ll need to install VirtualBox: Oracle VM VirtualBox

Download our OVA file to get a preconfigured LAMP server local: virtualmin-by-marasit.ova

This OVA file contains 2 users by default:

UsernamePassword
rootroot
userroot

Second, you’ll need to launch VirtualBox to import the OVA File

Open File > Import Appliance

Select the OVA file from your computer

Change the values according to your machine CPU RAM & Click Import

Wait for the import to finish

Increase storage size to 20Gb+ How To Enlarge a Virtual Machine’s Disk in VirtualBox or VMware (howtogeek.com) (TODO)

And verify your conf in settings

Configure your website

Start your VirtualMachine

Connect with : user / root – VirtualBox keyboard is AZERTY

Get ip address of the machine :

ip addr

Add the ip and VirtualBox hostname to your windows virtualhost : C:\Windows\System32\drivers\etc\hosts

Go to https://host.virtualmin.com:10000

Install your new virtual server

Update your \etc\hosts to add your new website

Add a ssl certificate

Add cert to browser (TODO)

Go to your webiste : https://local.marasit.com

Configure VSCode

In VSCODE go to extensions share SSH by microsoft

in remote explorer :

Click to your website -> connect

ENTER

Mount host files to virtualmin

Create a shared directory in your virtualbox

In your remote SSH as root

mount -t vboxsf shared home/<my user>/public_html

In local directory

Execute the git clone in the local directory as explain in that article

Upload DB to virtualmin

Download db

Follow the link from that article

Check db permissions

Import DB via mysql after uploading sql file in server

php wp-cli.phar db import /path/to/imports/db-uat-yyyy-mm-dd.sql

If you have reached the end of that article, you must be ready to start developping.

For any other questions, feel free to contact your project manager.