The aim of this paper is to extend the discussion on the free-energy principle (FEP), from the predictive coding theory, which is an explanatory theory of the brain, to the problem of autonomy of self-organizing living systems. From the point of view of self-organization of living systems, FEP implies that biological organisms, due to the systemic coupling with the world, are characterized by an ongoing flow of exchanging information and energy with the environment, which has to be controlled in order to maintain the integrity of the organism. In terms of dynamical system theory, this means that living systems have a dynamic state space, which can be configured by the way they control the free-energy. In the process of controlling their free-energy and modeling of the state space, an important role is played by the anticipatory structures of the organisms, which would reduce the external surprises and adjust the behavior of the organism by anticipating the changes in the environment. In this way, in the dynamic state space of a living system new behavioral patterns emerge enabling new degrees of freedom at the level of the whole. Thus, my aim in this article is to explain how FEP, as a principle of self-organization of living system, contributes to the configuring of the state space of an organism and the emergence of new degrees of freedom, both important in the process of gaining and maintaining the autonomy of a living organism.