In this paper, we study Friedmann cosmology with time-varying vacuum energy density in the context of Brans–Dicke theory. We consider an isotropic and homogeneous flat space, filled with a matter-dominated perfect fluid and a dynamical cosmological term varLambda (t) , obeying the equation of state of the vacuum. As the exact nature of a possible time-varying vacuum is yet to be found, we explore varLambda (t) given by the phenomenological law varLambda (t)=lambda +sigma H, where lambda and sigma are positive constants. We solve the model and then focus on two different cases varLambda _{H1} and varLambda _{H2} by assuming varLambda =lambda and varLambda =sigma H, respectively. Notice that varLambda _{H1} is the analog of the standard varLambda CDM, but within the Brans–Dicke cosmology. We find the analytical solution of the main cosmological functions such as the Hubble parameter, the scale factor, deceleration and equation of state parameters for these models. In order to test the viability of the cosmological scenarios, we perform two sets of joint observational analyses of the recent Type Ia supernova data (Pantheon), observational measurements of Hubble parameter data, Baryon acoustic oscillation/Cosmic microwave background data and Local Hubble constant for each model. For the sake of comparison, the same data analysis is performed for the varLambda CDM model. Each model shows a transition from decelerated phase to accelerated phase and can be viewed as an effective quintessence behavior. Using the model selection criteria AIC and BIC to distinguish from existing dark energy models, we find that the Brans–Dicke analog of the varLambda -cosmology (i.e. our model varLambda _{H1}) performs at a level comparable to the standard varLambda CDM, whereas varLambda _{H2} is less favoured.