PurposeThe purpose of the study is to explore the interrelation between internal factors of learners and the external environment. The results of this study help to design a learning environment that improves students' self-efficacy and consequently self-regulated learning (SRL) behaviors of students.Design/methodology/approachThe study adopts a quantitative approach to explore the relationship between learner's self-efficacy, self-regulation behavior and three factors in the online learning environment: course design, learning activities and relationship with instructors and peers. Participants of the study are 350 students in two universities in Vietnam.FindingsThe study finds that factors in the learning environment namely course design, learning activities and relationship within class significantly affect students' self-regulation. Moreover, results show that students' self-efficacy plays the mediating role in the relationship between learning environment and self-regulation.Research limitations/implicationsSamples are taken by convenience sampling method, which may lead to sampling bias, and results may, to some extent, be misleading. The study was conducted in only two universities with limited student populations. A larger sample of students from other institutions may contribute to a better explanation of the relationships.Practical implicationsThe study has a practical implication of contributing to the limited understanding of learners in an underdeveloped-research country context. The study also implies necessary changes to the long-standing, prevalent yet ineffective teaching and learning style.Social implicationsThe study calls for a renovation in the nation's traditional educational practices, having a social implication of creating a learning environment beneficial for learners.Originality/valueThis study is the first to investigate the impact of online learning environment and students' internal factors on their learning behaviors in Vietnam. The study is among the very few empirical research studies on the country's education generally and on self-regulation specifically, contributing to better understanding of learning experiences and the improvement of teaching.