In 2015, the United Nations adopted the 2030 Agenda for Sustainable Development, with 17 Sustainable Development Goals (SDGs) at its core. Besides tackling climate change and the fight to reduce inequality, the SDG number 12 is specifically focused to develop strategies toward food sustainability. The aim of this study, aligned with SDG number 12, was to analyze the level of knowledge and perceptions of food sustainability in a university community from Spain. A descriptive cross-sectional study, based on an online questionnaire, was carried out between July and November 2021 with convenience sampling. The survey included 28 items and was distributed among students, teachers, researchers and administrative staff from a Spanish university. A total of 1,220 participants completed the survey. 70.4% of the respondents heard about the environmental impact of food and more than 50% were aware of the existence of the SDGs. The different aspects related to diet that concerned them the most were food waste, plastic usage, and environmental impact. They reported that a sustainable diet should be mainly based on local and seasonal products and with a low environmental impact as well as no or the minimum food waste. When asked if they were following a sustainable diet, 77% answered affirmatively. Moreover, the food groups more involved in a sustainable diet should be vegetables and fruits, olive oil, legumes, and whole grains. Regarding food waste, 60% of the surveyed population claimed to generate it at home, with the use of leftovers and planning shopping and meals being some of the most important domestic actions to avoid it. Further initiatives must be implemented to increase the level of knowledge as well as to raise the awareness on the importance to translate it into individual and collective actions that allow a shift toward more sustainable practices.