First time users can obtain a free tier for a year with AWS, however, they will still ask for payment information if I am not mistaken. The nice thing about this solution is you can teach your students how to use Amazon Web Services such as Elasticbeanstalk, Elastic Compute Cloud (EC2) and these skills are valuable.
Whereas, using a vanilla Linux server through Digital Ocean or Linode can also be educational, it would be highly technical, meaning a lot of use of the terminal command line, setting up SSH creds, securing, hardening and optimizing a Linux server which the average beginner and lay person does not know how to do and you do not need to self-disclose, but if you do not know how to do this, then just go with Amazon Web Services as I suggest.
Having students playing around a Linux server without knowing security principles and practices is not right, but don't take my word for it, set up a Linux server for yourself as a test on DO or Linode and wait awhile, wait for Linode customer support to inform you about some repeated attempts at brute-force attack on your server.
It's not personal, these scripts are out there and they sniff out servers that are not well-secured and not having anything of value is not the issue, I imagine you want these students to learn well, so if the Principles of Least Privilege and securing, optimizing and hardening a Linux server is not in the scope of your course, go with AWS.
You can always show them how to shut down an EC2 instance and Elasticbeanstalk as part of the course.