From Joomla! Documentation

Ideally this should be on the same platform (operating system, PHP and database version) as the live site, but don't worry if this is not possible. Making a working copy of a Joomla! website involves copying the files and the database (these are separate activities). You will then need to amend the configuration.php to reflect the new location. Check that your test site is fully functional.