I figured it out myself. I'll post the solution here if anyone else needs it. You just need to add this line in the index.php file:
Code:
<?php query_posts($query_string . '&orderby=rand') ?>
It should be added right above this line:
Code:
<?php while (have_posts()) : the_post(); ?>