Use the PyRx software all you have to do is to right click the open Babel section after importing your ligands, you would find the energy minimization option
Minimization of the protein has not to be a compulsory method to apply before docking because the original cavity and protein conformation (e.g. active or inactive conformation, soluble…) or in may suffer major changes and almost disappear. Doing a minimization you are assuming that a theoretical model is more valid than the experimental one (X-Ray, NMR…). In this sense, if you want to explore some mobility aspects, you can define flexible residues of the protein and perform a flexible docking.
On the other hand, a minimization of the ligand makes more sense to optimize bond distances and angles mainly in a quantum chemistry level calculation.