If you are the only developer and tester of the site, then simply install WAMP (Windows), MAMP (MacOS), or XAMPP on your development machine. You will then be able to install OpenCart, edit any files, and perform testing using a browser and going to http://localhost/
If there are a number of developers, or you need the development environment to be accessible to other people in other locations, simply setup a subdomain under your existing domain (like "dev.server.com" where the production site is "server.com") and install it there. (If you go this route, I would suggest researching HTACCESS rules to limit access to the development environment to yourself and other authorised people, rather than making it completely public.)