Dev-Ops with bitbucket
I had this problem when I needed to build something at home.

What I did:


installed docker in a Ubuntu server VM
installed docker in a windows server 2016 VM (if you need windows containers like i did)


THEN: 
In the Ubuntu machine:


I created a local registry running in a container (1 command :)  )
I spin up a container with a git server - I "linked" the configuration folder to a folder in my machine for persistence.  
I spinn a container with jenkins server (same trick with the folder)
I spin up containers with slaves
I have a database container attached to a nexus container for artifacts and build dependencies


In windows VM : 


I spin a jenkins slave container to build windows apps 
I spin IIS machines to test the built app


My home computer is 32 GB ram / core i7 and it works great , even with windows container databases (these are monstrous) 

Tricky for me - work in progress - build a container in a slave running in a container . It can be done but I am on googling phase.

Advantages:


if you use docker compose and you save your containers in the local registry you get to move your work easily . I always version my docker compose files in a github repo.
you can pause the VM host and move everything in some other host. 
you can branch your things for having a test env by cloning the machine and copying the host folders