Understanding molecular recognition of small molecules by proteins in atomistic detail is key for drug design. Molecular docking is a widely used computational method to mimic ligand-protein association in silico. However, predicting conformational changes occurring in proteins upon ligand binding is still a major challenge. Ensemble docking approaches address this issue by considering a set of different conformations of the protein obtained either experimentally or from computer simulations, e.g., molecular dynamics. However, holo structures prone to host (the correct) ligands are generally poorly sampled by standard molecular dynamics simulations of the apo protein. In order to address this limitation, we introduce a computational approach based on metadynamics simulations called ensemble docking with enhanced sampling of pocket shape (EDES) that allows holo-like conformations of proteins to be generated by exploiting only their apo structures. This is achieved by defining a set of collective variables that effectively sample different shapes of the binding site, ultimately mimicking the steric effect due to the ligand. We assessed the method on three challenging proteins undergoing different extents of conformational changes upon ligand binding. In all cases our protocol generates a significant fraction of structures featuring a low RMSD from the experimental holo geometry. Moreover, ensemble docking calculations using those conformations yielded in all cases native-like poses among the top-ranked ones.