You need a visa for Cocos (Keeling) Islands if you have a Spanish passport
Visa options for Cocos (Keeling) Islands
Electronic visitor visa
To visit Cocos (Keeling) Islands for Business or Tourism, you require a visa. An eVisa is the fastest and easiest way of obtaining an Cocos (Keeling) Islands visa as you can submit an application and supporting documents online. If approved, you'll receive your eVisa confirmation electronically. When you arrive in Cocos (Keeling) Islands, border crossing will ask for your passport and eVisa to ensure you have the proper visas. For all other visas, visit the government site.