This is the first one of a series of papers about zeta regularization of the divergences appearing in the vacuum expectation value (VEV) of several local and global observables in quantum field theory. More precisely we consider a quantized, neutral scalar field on a domain in any spatial dimension, with arbitrary boundary conditions and, possibly, in presence of an external classical potential. We analyze, in particular, the VEV of the stress-energy tensor, the corresponding boundary forces and the total energy, thus taking into account both local and global aspects of the Casimir effect. In comparison with the wide existing literature on these subjects, we try to develop a more systematic approach, allowing to treat specific configurations by mere application of a general machinery. The present Part I is mainly devoted to setting up this general framework; at the end of the paper, this is exemplified in a very simple case. In Parts II, III and IV we will consider more engaging applications, indicated in the Introduction of the present work.